1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-08 08:58:27 +03:00

sd-event: implicitly set signal event source's descriptions to the signal name

This commit is contained in:
Lennart Poettering 2014-11-04 16:34:20 +01:00
parent 356779df90
commit f1f00dbb7f
2 changed files with 3 additions and 8 deletions

View File

@ -803,18 +803,10 @@ static int setup_signals(RemoteServer *s) {
if (r < 0)
return r;
r = sd_event_source_set_description(s->sigterm_event, "sigterm");
if (r < 0)
return r;
r = sd_event_add_signal(s->events, &s->sigint_event, SIGINT, NULL, s);
if (r < 0)
return r;
r = sd_event_source_set_description(s->sigint_event, "sigint");
if (r < 0)
return r;
return 0;
}

View File

@ -1031,6 +1031,9 @@ _public_ int sd_event_add_signal(
}
}
/* Use the signal name as description for the event source by default */
(void) sd_event_source_set_description(s, signal_to_string(sig));
if (ret)
*ret = s;