chiark / gitweb /
core: two more log_unit_*_errno() conversions
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 28 Nov 2014 12:54:40 +0000 (13:54 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Fri, 28 Nov 2014 12:54:40 +0000 (13:54 +0100)
src/core/automount.c
src/core/busname.c

index 3f34a2895f2c11186700b9faeec0a917f5ebaad7..bc2834334e2fa9930902ee252e157c4e15f2e1f6 100644 (file)
@@ -744,7 +744,10 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo
 
         l = loop_read(a->pipe_fd, &packet, sizeof(packet), true);
         if (l != sizeof(packet)) {
-                log_unit_error(UNIT(a)->id, "Invalid read from pipe: %s", l < 0 ? strerror(-l) : "short read");
+                if (l < 0)
+                        log_unit_error_errno(UNIT(a)->id, l, "Invalid read from pipe: %m");
+                else
+                        log_unit_error(UNIT(a)->id, "Invalid read from pipe: short read");
                 goto fail;
         }
 
index 6a0aef8d1fbce6f2ae588e16eca7954aa89ff13e..7e7f7b384c3afba091635ad43cb8936778c1b517 100644 (file)
@@ -304,7 +304,7 @@ static int busname_open_fd(BusName *n) {
         mode = UNIT(n)->manager->running_as == SYSTEMD_SYSTEM ? "system" : "user";
         n->starter_fd = bus_kernel_open_bus_fd(mode, &path);
         if (n->starter_fd < 0) {
-                log_unit_warning(UNIT(n)->id, "Failed to open %s: %s", path ?: "kdbus", strerror(-n->starter_fd));
+                log_unit_warning_errno(UNIT(n)->id, n->starter_fd, "Failed to open %s: %m", path ?: "kdbus");
                 return n->starter_fd;
         }