mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-28 07:21:32 +03:00
hostnamed,localed,timedate: properly propagate errors from sd_event_add_signal()
main() can't doesn't expect negative error codes as return.
This commit is contained in:
parent
cd0504a395
commit
4b670f8688
@ -732,12 +732,16 @@ int main(int argc, char *argv[]) {
|
||||
(void) sd_event_set_watchdog(event, true);
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGINT handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGTERM handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = connect_bus(&context, event, &bus);
|
||||
if (r < 0)
|
||||
|
@ -751,12 +751,16 @@ int main(int argc, char *argv[]) {
|
||||
(void) sd_event_set_watchdog(event, true);
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGINT handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGTERM handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = connect_bus(&context, event, &bus);
|
||||
if (r < 0)
|
||||
|
@ -987,12 +987,16 @@ int main(int argc, char *argv[]) {
|
||||
(void) sd_event_set_watchdog(event, true);
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGINT, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGINT handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = sd_event_add_signal(event, NULL, SIGTERM, NULL, NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to install SIGTERM handler: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
r = connect_bus(&context, event, &bus);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user