mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 19:32:36 +08:00
Use same warnx/exit pattern
This commit is contained in:
@@ -181,17 +181,13 @@ int gpio_led_main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
gpio_led_started = true;
|
gpio_led_started = true;
|
||||||
warnx("start, using pin: %s", pin_name);
|
warnx("start, using pin: %s", pin_name);
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit(0);
|
|
||||||
|
|
||||||
|
|
||||||
} else if (!strcmp(argv[1], "stop")) {
|
} else if (!strcmp(argv[1], "stop")) {
|
||||||
if (gpio_led_started) {
|
if (gpio_led_started) {
|
||||||
gpio_led_started = false;
|
gpio_led_started = false;
|
||||||
// FIXME: Is this correct? changed from warnx
|
warnx("stop");
|
||||||
errx(0, "stop");
|
exit(0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
errx(1, "not running");
|
errx(1, "not running");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user