diff options
author | Tom Gundersen <teg@jklm.no> | 2014-08-28 15:48:07 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-08-28 21:19:17 +0200 |
commit | 752bbf75b9b52c0faae29bb4b77a99c4bb0d298f (patch) | |
tree | bfb43432a44b89726cbd3d25d03cd2000bb28f25 /src/libsystemd/sd-event/sd-event.c | |
parent | f7f53e9e6ebb9f656d880f5e779fc174a1d983bf (diff) |
sd-event: use event source name rather than address in debug messages
Diffstat (limited to 'src/libsystemd/sd-event/sd-event.c')
-rw-r--r-- | src/libsystemd/sd-event/sd-event.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index a2935abd64..c92e065c76 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -2112,8 +2112,12 @@ static int source_dispatch(sd_event_source *s) { s->dispatching = false; - if (r < 0) - log_debug("Event source %p returned error, disabling: %s", s, strerror(-r)); + if (r < 0) { + if (s->name) + log_debug("Event source '%s' returned error, disabling: %s", s->name, strerror(-r)); + else + log_debug("Event source %p returned error, disabling: %s", s, strerror(-r)); + } if (s->n_ref == 0) source_free(s); @@ -2146,8 +2150,12 @@ static int event_prepare(sd_event *e) { r = s->prepare(s, s->userdata); s->dispatching = false; - if (r < 0) - log_debug("Prepare callback of event source %p returned error, disabling: %s", s, strerror(-r)); + if (r < 0) { + if (s->name) + log_debug("Prepare callback of event source '%s' returned error, disabling: %s", s->name, strerror(-r)); + else + log_debug("Prepare callback of event source %p returned error, disabling: %s", s, strerror(-r)); + } if (s->n_ref == 0) source_free(s); |