|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 752bbf75b9b52c0faae29bb4b77a99c4bb0d298f Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 28 Aug 2014 15:48:07 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] sd-event: use event source name rather than address in debug
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
messages
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd/sd-event/sd-event.c | 16 ++++++++++++----
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 12 insertions(+), 4 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index a2935abd64..c92e065c76 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd/sd-event/sd-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd/sd-event/sd-event.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2112,8 +2112,12 @@ static int source_dispatch(sd_event_source *s) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
s->dispatching = false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_debug("Event source %p returned error, disabling: %s", s, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (s->name)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("Event source '%s' returned error, disabling: %s", s->name, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ else
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("Event source %p returned error, disabling: %s", s, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (s->n_ref == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
source_free(s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -2146,8 +2150,12 @@ static int event_prepare(sd_event *e) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
r = s->prepare(s, s->userdata);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
s->dispatching = false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- log_debug("Prepare callback of event source %p returned error, disabling: %s", s, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (s->name)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("Prepare callback of event source '%s' returned error, disabling: %s", s->name, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ else
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_debug("Prepare callback of event source %p returned error, disabling: %s", s, strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (s->n_ref == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
source_free(s);
|