diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 17:09:20 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2014-11-28 17:17:51 +0100 |
commit | c33b329709ebe2755181980a050d02ec7c81ed87 (patch) | |
tree | 39080c428c72c90daddbe1c08d45c181adf1476c /src/libsystemd-terminal | |
parent | 5567fafbc9d83a1391f23ecdbe698a3c03929370 (diff) |
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups.
Diffstat (limited to 'src/libsystemd-terminal')
-rw-r--r-- | src/libsystemd-terminal/grdev-drm.c | 40 | ||||
-rw-r--r-- | src/libsystemd-terminal/grdev.c | 16 | ||||
-rw-r--r-- | src/libsystemd-terminal/idev-evdev.c | 28 | ||||
-rw-r--r-- | src/libsystemd-terminal/idev-keyboard.c | 31 | ||||
-rw-r--r-- | src/libsystemd-terminal/idev.c | 12 | ||||
-rw-r--r-- | src/libsystemd-terminal/sysview.c | 90 |
6 files changed, 105 insertions, 112 deletions
diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c index 48f8e9ce96..2d678e8acf 100644 --- a/src/libsystemd-terminal/grdev-drm.c +++ b/src/libsystemd-terminal/grdev-drm.c @@ -2186,8 +2186,8 @@ static void grdrm_card_hotplug(grdrm_card *card) { card->ready = false; r = grdrm_card_resync(card); if (r < 0) { - log_debug("grdrm: %s/%s: cannot re-sync card: %s", - card->base.session->name, card->base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot re-sync card: %m", + card->base.session->name, card->base.name); return; } @@ -2415,8 +2415,8 @@ static int grdrm_card_open(grdrm_card *card, int dev_fd) { r = ioctl(card->fd, DRM_IOCTL_GET_CAP, &cap); card->cap_dumb = r >= 0 && cap.value; if (r < 0) - log_debug("grdrm: %s/%s: cannot retrieve DUMB_BUFFER capability: %s", - card->base.session->name, card->base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot retrieve DUMB_BUFFER capability: %m", + card->base.session->name, card->base.name); else if (!card->cap_dumb) log_debug("grdrm: %s/%s: DUMB_BUFFER capability not supported", card->base.session->name, card->base.name); @@ -2427,8 +2427,8 @@ static int grdrm_card_open(grdrm_card *card, int dev_fd) { r = ioctl(card->fd, DRM_IOCTL_GET_CAP, &cap); card->cap_monotonic = r >= 0 && cap.value; if (r < 0) - log_debug("grdrm: %s/%s: cannot retrieve TIMESTAMP_MONOTONIC capability: %s", - card->base.session->name, card->base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot retrieve TIMESTAMP_MONOTONIC capability: %m", + card->base.session->name, card->base.name); else if (!card->cap_monotonic) log_debug("grdrm: %s/%s: TIMESTAMP_MONOTONIC is disabled globally, fix this NOW!", card->base.session->name, card->base.name); @@ -2507,8 +2507,8 @@ static void unmanaged_card_enable(grdev_card *basecard) { r = grdrm_card_open(&cu->card, fd); if (r < 0) { - log_debug("grdrm: %s/%s: cannot open: %s", - basecard->session->name, basecard->name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot open: %m", + basecard->session->name, basecard->name); return; } } @@ -2580,8 +2580,8 @@ static int unmanaged_card_new(grdev_card **out, grdev_session *session, struct u r = grdrm_card_open(&cu->card, fd); if (r < 0) - log_debug("grdrm: %s/%s: cannot open: %s", - basecard->session->name, basecard->name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot open: %m", + basecard->session->name, basecard->name); } if (out) @@ -2724,8 +2724,8 @@ static int managed_card_pause_device_fn(sd_bus *bus, } if (r < 0) - log_debug("grdrm: %s/%s: cannot send PauseDeviceComplete: %s", - session->name, cm->card.base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot send PauseDeviceComplete: %m", + session->name, cm->card.base.name); } return 0; @@ -2778,8 +2778,8 @@ static int managed_card_resume_device_fn(sd_bus *bus, r = grdrm_card_open(&cm->card, fd); if (r < 0) { - log_debug("grdrm: %s/%s: cannot open: %s", - session->name, cm->card.base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot open: %m", + session->name, cm->card.base.name); return 0; } } @@ -2870,8 +2870,8 @@ static int managed_card_take_device_fn(sd_bus *bus, r = grdrm_card_open(&cm->card, fd); if (r < 0) { - log_debug("grdrm: %s/%s: cannot open: %s", - session->name, cm->card.base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot open: %m", + session->name, cm->card.base.name); return 0; } @@ -2912,8 +2912,8 @@ static void managed_card_take_device(managed_card *cm) { return; error: - log_debug("grdrm: %s/%s: cannot send TakeDevice request: %s", - session->name, cm->card.base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot send TakeDevice request: %m", + session->name, cm->card.base.name); } static void managed_card_release_device(managed_card *cm) { @@ -2955,8 +2955,8 @@ static void managed_card_release_device(managed_card *cm) { } if (r < 0 && r != -ENOTCONN) - log_debug("grdrm: %s/%s: cannot send ReleaseDevice: %s", - session->name, cm->card.base.name, strerror(-r)); + log_debug_errno(r, "grdrm: %s/%s: cannot send ReleaseDevice: %m", + session->name, cm->card.base.name); } static int managed_card_new(grdev_card **out, grdev_session *session, struct udev_device *ud) { diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c index 0c21eac551..db87ede762 100644 --- a/src/libsystemd-terminal/grdev.c +++ b/src/libsystemd-terminal/grdev.c @@ -577,8 +577,8 @@ static bool display_cache(grdev_display *display) { out: if (r < 0) - log_debug("grdev: %s/%s: cannot cache pipes: %s", - display->session->name, display->name, strerror(-r)); + log_debug_errno(r, "grdev: %s/%s: cannot cache pipes: %m", + display->session->name, display->name); return true; } @@ -772,8 +772,8 @@ void grdev_pipe_schedule(grdev_pipe *pipe, uint64_t frames) { return; error: - log_debug("grdev: %s/%s/%s: cannot schedule vsync timer: %s", - pipe->card->session->name, pipe->card->name, pipe->name, strerror(-r)); + log_debug_errno(r, "grdev: %s/%s/%s: cannot schedule vsync timer: %m", + pipe->card->session->name, pipe->card->name, pipe->name); } /* @@ -1176,8 +1176,8 @@ void grdev_session_add_drm(grdev_session *session, struct udev_device *ud) { r = grdev_drm_card_new(&card, session, ud); if (r < 0) { - log_debug("grdev: %s: cannot add DRM device for %s: %s", - session->name, udev_device_get_syspath(ud), strerror(-r)); + log_debug_errno(r, "grdev: %s: cannot add DRM device for %s: %m", + session->name, udev_device_get_syspath(ud)); return; } @@ -1269,8 +1269,8 @@ static void session_configure(grdev_session *session) { } else if (!display) { r = grdev_display_new(&display, session, pipe->name); if (r < 0) { - log_debug("grdev: %s/%s: cannot create display for pipe %s: %s", - session->name, card->name, pipe->name, strerror(-r)); + log_debug_errno(r, "grdev: %s/%s: cannot create display for pipe %s: %m", + session->name, card->name, pipe->name); continue; } } diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c index 63fa89e47d..b3e86bfb19 100644 --- a/src/libsystemd-terminal/idev-evdev.c +++ b/src/libsystemd-terminal/idev-evdev.c @@ -222,8 +222,8 @@ static int idev_evdev_io(idev_evdev *evdev) { } if (error < 0) - log_debug("idev-evdev: %s/%s: error on data event: %s", - e->session->name, e->name, strerror(-error)); + log_debug_errno(error, "idev-evdev: %s/%s: error on data event: %m", + e->session->name, e->name); return error; error: @@ -448,8 +448,8 @@ static void unmanaged_evdev_resume(idev_element *e) { r = idev_evdev_resume(&eu->evdev, fd); if (r < 0) - log_debug("idev-evdev: %s/%s: cannot resume: %s", - e->session->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot resume: %m", + e->session->name, e->name); } static void unmanaged_evdev_pause(idev_element *e) { @@ -571,8 +571,8 @@ static int managed_evdev_take_device_fn(sd_bus *bus, r = idev_evdev_resume(&em->evdev, fd); if (r < 0) - log_debug("idev-evdev: %s/%s: cannot resume: %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot resume: %m", + s->name, e->name); return 0; } @@ -621,8 +621,8 @@ static void managed_evdev_enable(idev_element *e) { return; error: - log_debug("idev-evdev: %s/%s: cannot send TakeDevice request: %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot send TakeDevice request: %m", + s->name, e->name); } static void managed_evdev_disable(idev_element *e) { @@ -679,8 +679,8 @@ static void managed_evdev_disable(idev_element *e) { } if (r < 0 && r != -ENOTCONN) - log_debug("idev-evdev: %s/%s: cannot send ReleaseDevice: %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot send ReleaseDevice: %m", + s->name, e->name); } static void managed_evdev_resume(idev_element *e, int fd) { @@ -705,8 +705,8 @@ static void managed_evdev_resume(idev_element *e, int fd) { r = idev_evdev_resume(&em->evdev, fd); if (r < 0) - log_debug("idev-evdev: %s/%s: cannot resume: %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot resume: %m", + s->name, e->name); return; } @@ -776,8 +776,8 @@ static void managed_evdev_pause(idev_element *e, const char *mode) { } if (r < 0) - log_debug("idev-evdev: %s/%s: cannot send PauseDeviceComplete: %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev-evdev: %s/%s: cannot send PauseDeviceComplete: %m", + s->name, e->name); } } diff --git a/src/libsystemd-terminal/idev-keyboard.c b/src/libsystemd-terminal/idev-keyboard.c index a26a49a80d..e971ab360d 100644 --- a/src/libsystemd-terminal/idev-keyboard.c +++ b/src/libsystemd-terminal/idev-keyboard.c @@ -284,8 +284,8 @@ static int kbdctx_refresh_compose_table(kbdctx *kc, const char *lang) { * it as a hard-failure but just continue. Preferably, we want * xkb to tell us exactly whether compilation failed or whether * there is no compose file available for this locale. */ - log_debug("idev-keyboard: cannot load compose-table for '%s': %s", - lang, strerror(-r)); + log_debug_errno(r, "idev-keyboard: cannot load compose-table for '%s': %m", + lang); r = 0; kt = NULL; } @@ -333,8 +333,7 @@ static int kbdctx_refresh_keymap(kbdctx *kc) { r = kbdmap_new_from_names(&km, kc, kc->last_x11_model, kc->last_x11_layout, kc->last_x11_variant, kc->last_x11_options); if (r < 0) { - log_debug("idev-keyboard: cannot create keymap from locale1: %s", - strerror(-r)); + log_debug_errno(r, "idev-keyboard: cannot create keymap from locale1: %m"); return r; } @@ -648,8 +647,8 @@ static int keyboard_raise_data(idev_keyboard *k, idev_data *data) { r = idev_session_raise_device_data(d->session, d, data); if (r < 0) - log_debug("idev-keyboard: %s/%s: error while raising data event: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: error while raising data event: %m", + d->session->name, d->name); return r; } @@ -952,8 +951,8 @@ static void keyboard_repeat(idev_keyboard *k) { r = keyboard_fill(k, repdata, false, evkbd->keycode, KBDKEY_REPEAT, num, keysyms); if (r < 0) { - log_debug("idev-keyboard: %s/%s: cannot set key-repeat: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: cannot set key-repeat: %m", + d->session->name, d->name); k->repeating = false; keyboard_arm(k, 0); } else { @@ -977,8 +976,8 @@ static void keyboard_repeat(idev_keyboard *k) { r = keyboard_fill(k, repdata, false, repkbd->keycode, KBDKEY_REPEAT, num, keysyms); if (r < 0) { - log_debug("idev-keyboard: %s/%s: cannot update key-repeat: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: cannot update key-repeat: %m", + d->session->name, d->name); k->repeating = false; keyboard_arm(k, 0); } @@ -1067,8 +1066,8 @@ static int keyboard_feed_evdev(idev_keyboard *k, idev_data *data) { return keyboard_raise_data(k, &k->evdata); error: - log_debug("idev-keyboard: %s/%s: cannot handle event: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: cannot handle event: %m", + d->session->name, d->name); k->repeating = false; keyboard_arm(k, 0); return 0; @@ -1128,8 +1127,8 @@ static int keyboard_update_kbdmap(idev_keyboard *k) { return 0; error: - log_debug("idev-keyboard: %s/%s: cannot adopt new keymap: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: cannot adopt new keymap: %m", + d->session->name, d->name); return r; } @@ -1162,8 +1161,8 @@ static int keyboard_update_kbdtbl(idev_keyboard *k) { return 0; error: - log_debug("idev-keyboard: %s/%s: cannot adopt new compose table: %s", - d->session->name, d->name, strerror(-r)); + log_debug_errno(r, "idev-keyboard: %s/%s: cannot adopt new compose table: %m", + d->session->name, d->name); return r; } diff --git a/src/libsystemd-terminal/idev.c b/src/libsystemd-terminal/idev.c index e979b608b6..989683f39a 100644 --- a/src/libsystemd-terminal/idev.c +++ b/src/libsystemd-terminal/idev.c @@ -351,8 +351,8 @@ static int session_add_device(idev_session *s, idev_device *d) { error: if (r < 0) - log_debug("idev: %s: error while adding device '%s': %s", - s->name, d->name, strerror(-r)); + log_debug_errno(r, "idev: %s: error while adding device '%s': %m", + s->name, d->name); return r; } @@ -372,8 +372,8 @@ static int session_remove_device(idev_session *s, idev_device *d) { idev_device_disable(d); if (error < 0) - log_debug("idev: %s: error while removing device '%s': %s", - s->name, d->name, strerror(-error)); + log_debug_errno(error, "idev: %s: error while removing device '%s': %m", + s->name, d->name); idev_device_free(d); return error; } @@ -420,8 +420,8 @@ static int session_remove_element(idev_session *s, idev_element *e) { element_disable(e); if (error < 0) - log_debug("idev: %s: error while removing element '%s': %s", - s->name, e->name, strerror(-r)); + log_debug_errno(r, "idev: %s: error while removing element '%s': %m", + s->name, e->name); idev_element_free(e); return error; } diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c index 9eb659777a..62d9b66060 100644 --- a/src/libsystemd-terminal/sysview.c +++ b/src/libsystemd-terminal/sysview.c @@ -295,8 +295,8 @@ static int session_take_control_fn(sd_bus *bus, r = context_raise_session_control(session->seat->context, session, error); if (r < 0) - log_debug("sysview: callback failed while signalling session control '%d' on session '%s': %s", - error, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while signalling session control '%d' on session '%s': %m", + error, session->name); return 0; } @@ -365,8 +365,8 @@ void sysview_session_release_control(sysview_session *session) { r = sd_bus_send(session->seat->context->sysbus, m, NULL); if (r < 0 && r != -ENOTCONN) - log_debug("sysview: %s: cannot send ReleaseControl: %s", - session->name, strerror(-r)); + log_debug_errno(r, "sysview: %s: cannot send ReleaseControl: %m", + session->name); } /* @@ -604,8 +604,8 @@ static void context_add_device(sysview_context *c, sysview_device *device) { r = context_raise_session_attach(c, session, device); if (r < 0) - log_debug("sysview: callback failed while attaching device '%s' to session '%s': %s", - device->name, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while attaching device '%s' to session '%s': %m", + device->name, session->name); } } @@ -625,8 +625,8 @@ static void context_remove_device(sysview_context *c, sysview_device *device) { r = context_raise_session_detach(c, session, device); if (r < 0) - log_debug("sysview: callback failed while detaching device '%s' from session '%s': %s", - device->name, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while detaching device '%s' from session '%s': %m", + device->name, session->name); } sysview_device_free(device); @@ -648,8 +648,8 @@ static void context_change_device(sysview_context *c, sysview_device *device, st r = context_raise_session_refresh(c, session, device, ud); if (r < 0) - log_debug("sysview: callback failed while changing device '%s' on session '%s': %s", - device->name, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while changing device '%s' on session '%s': %m", + device->name, session->name); } } @@ -683,8 +683,8 @@ static void context_add_session(sysview_context *c, sysview_seat *seat, const ch session->public = true; r = context_raise_session_add(c, session); if (r < 0) { - log_debug("sysview: callback failed while adding session '%s': %s", - session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while adding session '%s': %m", + session->name); session->public = false; goto error; } @@ -692,8 +692,8 @@ static void context_add_session(sysview_context *c, sysview_seat *seat, const ch HASHMAP_FOREACH(device, seat->device_map, i) { r = context_raise_session_attach(c, session, device); if (r < 0) - log_debug("sysview: callback failed while attaching device '%s' to new session '%s': %s", - device->name, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while attaching device '%s' to new session '%s': %m", + device->name, session->name); } } @@ -701,8 +701,8 @@ static void context_add_session(sysview_context *c, sysview_seat *seat, const ch error: if (r < 0) - log_debug("sysview: error while adding session '%s': %s", - id, strerror(-r)); + log_debug_errno(r, "sysview: error while adding session '%s': %m", + id); } static void context_remove_session(sysview_context *c, sysview_session *session) { @@ -719,15 +719,15 @@ static void context_remove_session(sysview_context *c, sysview_session *session) HASHMAP_FOREACH(device, session->seat->device_map, i) { r = context_raise_session_detach(c, session, device); if (r < 0) - log_debug("sysview: callback failed while detaching device '%s' from old session '%s': %s", - device->name, session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while detaching device '%s' from old session '%s': %m", + device->name, session->name); } session->public = false; r = context_raise_session_remove(c, session); if (r < 0) - log_debug("sysview: callback failed while removing session '%s': %s", - session->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while removing session '%s': %m", + session->name); } if (!session->custom) @@ -756,8 +756,8 @@ static void context_add_seat(sysview_context *c, const char *id) { seat->public = true; r = context_raise_seat_add(c, seat); if (r < 0) { - log_debug("sysview: callback failed while adding seat '%s': %s", - seat->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while adding seat '%s': %m", + seat->name); seat->public = false; } @@ -765,8 +765,8 @@ static void context_add_seat(sysview_context *c, const char *id) { error: if (r < 0) - log_debug("sysview: error while adding seat '%s': %s", - id, strerror(-r)); + log_debug_errno(r, "sysview: error while adding seat '%s': %m", + id); } static void context_remove_seat(sysview_context *c, sysview_seat *seat) { @@ -789,8 +789,8 @@ static void context_remove_seat(sysview_context *c, sysview_seat *seat) { seat->public = false; r = context_raise_seat_remove(c, seat); if (r < 0) - log_debug("sysview: callback failed while removing seat '%s': %s", - seat->name, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while removing seat '%s': %m", + seat->name); } sysview_seat_free(seat); @@ -976,8 +976,8 @@ static int context_ud_hotplug(sysview_context *c, struct udev_device *d) { r = device_new_ud(&device, seat, type, d); if (r < 0) { - log_debug("sysview: cannot create device for udev-device '%s': %s", - syspath, strerror(-r)); + log_debug_errno(r, "sysview: cannot create device for udev-device '%s': %m", + syspath); return r; } @@ -1083,8 +1083,8 @@ static int context_ud_scan(sysview_context *c) { d = udev_device_new_from_syspath(c->ud, name); if (!d) { r = errno > 0 ? -errno : -EFAULT; - log_debug("sysview: cannot create udev-device for %s: %s", - name, strerror(-r)); + log_debug_errno(r, "sysview: cannot create udev-device for %s: %m", + name); continue; } @@ -1103,8 +1103,7 @@ static int context_ld_seat_new(sysview_context *c, sd_bus_message *signal) { r = sd_bus_message_read(signal, "so", &id, &path); if (r < 0) { - log_debug("sysview: cannot parse SeatNew from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: cannot parse SeatNew from logind: %m"); return r; } @@ -1119,8 +1118,7 @@ static int context_ld_seat_removed(sysview_context *c, sd_bus_message *signal) { r = sd_bus_message_read(signal, "so", &id, &path); if (r < 0) { - log_debug("sysview: cannot parse SeatRemoved from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: cannot parse SeatRemoved from logind: %m"); return r; } @@ -1141,8 +1139,7 @@ static int context_ld_session_new(sysview_context *c, sd_bus_message *signal) { r = sd_bus_message_read(signal, "so", &id, &path); if (r < 0) { - log_debug("sysview: cannot parse SessionNew from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: cannot parse SessionNew from logind: %m"); return r; } @@ -1177,16 +1174,16 @@ static int context_ld_session_new(sysview_context *c, sd_bus_message *signal) { r = context_raise_session_filter(c, id, seatid, username, uid); if (r < 0) - log_debug("sysview: callback failed while filtering session '%s': %s", - id, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while filtering session '%s': %m", + id); else if (r > 0) context_add_session(c, seat, id); return 0; error: - log_debug("sysview: failed retrieving information for new session '%s': %s", - id, strerror(-r)); + log_debug_errno(r, "sysview: failed retrieving information for new session '%s': %m", + id); return r; } @@ -1197,8 +1194,7 @@ static int context_ld_session_removed(sysview_context *c, sd_bus_message *signal r = sd_bus_message_read(signal, "so", &id, &path); if (r < 0) { - log_debug("sysview: cannot parse SessionRemoved from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: cannot parse SessionRemoved from logind: %m"); return r; } @@ -1299,8 +1295,7 @@ static int context_ld_list_seats_fn(sd_bus *bus, return 0; error: - log_debug("sysview: erroneous ListSeats response from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: erroneous ListSeats response from logind: %m"); return r; } @@ -1344,8 +1339,8 @@ static int context_ld_list_sessions_fn(sd_bus *bus, if (seat) { r = context_raise_session_filter(c, id, seatid, username, uid); if (r < 0) - log_debug("sysview: callback failed while filtering session '%s': %s", - id, strerror(-r)); + log_debug_errno(r, "sysview: callback failed while filtering session '%s': %m", + id); else if (r > 0) context_add_session(c, seat, id); } @@ -1365,8 +1360,7 @@ static int context_ld_list_sessions_fn(sd_bus *bus, return 0; error: - log_debug("sysview: erroneous ListSessions response from logind: %s", - strerror(-r)); + log_debug_errno(r, "sysview: erroneous ListSessions response from logind: %m"); return r; } |