summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-06 01:33:34 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-06 01:33:34 +0200
commit67370238b55df4126e505007d46deaff8bb55a36 (patch)
tree298d592bc9d2611f1fab60e6f9483400fdf86c11 /src
parent100fd5676c53c6709442a22db0253cc57f05c46d (diff)
manager: don't show PID for incoming signals if it is 0
Diffstat (limited to 'src')
-rw-r--r--src/manager.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/manager.c b/src/manager.c
index 9fc854b661..6ddd40e873 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -2059,8 +2059,6 @@ static int manager_process_signal_fd(Manager *m) {
assert(m);
for (;;) {
- char *p = NULL;
-
if ((n = read(m->signal_watch.fd, &sfsi, sizeof(sfsi))) != sizeof(sfsi)) {
if (n >= 0)
@@ -2072,13 +2070,17 @@ static int manager_process_signal_fd(Manager *m) {
return -errno;
}
- if (sfsi.ssi_pid > 0)
+ if (sfsi.ssi_pid > 0) {
+ char *p = NULL;
+
get_process_name(sfsi.ssi_pid, &p);
- log_debug("Received SIG%s from PID %lu (%s)",
- strna(signal_to_string(sfsi.ssi_signo)),
- (unsigned long) sfsi.ssi_pid, strna(p));
- free(p);
+ log_debug("Received SIG%s from PID %lu (%s).",
+ strna(signal_to_string(sfsi.ssi_signo)),
+ (unsigned long) sfsi.ssi_pid, strna(p));
+ free(p);
+ } else
+ log_debug("Received SIG%s.", strna(signal_to_string(sfsi.ssi_signo)));
switch (sfsi.ssi_signo) {