mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-30 20:48:33 -04:00
AP_HAL_Linux: check return value of system command
Compilation fails on disco without this patch as system is declared with attribute warn_unused_result
This commit is contained in:
parent
5f2dd57cca
commit
914e6c5497
@ -287,7 +287,10 @@ void GPIO_Sysfs::_gpio_script_thread(void)
|
||||
char cmd[100];
|
||||
snprintf(cmd, sizeof(cmd)-1, "/bin/sh %s %u %u", HAL_GPIO_SCRIPT, pv.pin, pv.value);
|
||||
hal.console->printf("Running: %s\n", cmd);
|
||||
system(cmd);
|
||||
const int system_ret = system(cmd);
|
||||
if (system_ret != 0) {
|
||||
hal.console->printf("Unexpected return value (%d)\n", system_ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user