chiark / gitweb /
sd-event: implicitly set signal event source's descriptions to the signal name
authorLennart Poettering <lennart@poettering.net>
Tue, 4 Nov 2014 15:34:20 +0000 (16:34 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 4 Nov 2014 17:09:19 +0000 (18:09 +0100)
src/journal-remote/journal-remote.c
src/libsystemd/sd-event/sd-event.c

index 03410c7..7239b8c 100644 (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;
 }
 
index f0356a4..e856d68 100644 (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;