Skip to content

Commit 3697519

Browse files
committed
Varargs export of function is not available in 2.9.
1 parent 50498e4 commit 3697519

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/hal/drivers/mesa-hostmot2/modbus/mesa_modbus.c.tmpl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ int rtapi_app_main(void){
182182
int c; // channel loop
183183
int p; // pin loops
184184
int j; // generic loops
185+
char hal_name[HAL_NAME_LEN];
185186

186187
rtapi_set_msg_level(DEBUG);
187188

@@ -227,8 +228,11 @@ int rtapi_app_main(void){
227228
inst->hal->buff = (rtapi_s64 *) hal_malloc(inst->num_pins * sizeof(rtapi_s64));
228229

229230
rtapi_strlcpy(inst->port, ports[i], HAL_NAME_LEN);
230-
231-
retval = hal_export_functf(process, inst, 1, 0, comp_id, COMP_NAME".%02i", i);
231+
retval = rtapi_snprintf(hal_name, HAL_NAME_LEN, COMP_NAME".%02i", i);
232+
if (retval >= HAL_NAME_LEN) {
233+
goto fail0;
234+
}
235+
retval = hal_export_funct(hal_name, process, inst, 1, 0, comp_id);
232236
if (retval < 0) {
233237
rtapi_print_msg(RTAPI_MSG_ERR, COMP_NAME" ERROR: function export failed\n");
234238
goto fail0;

0 commit comments

Comments
 (0)