chiark / gitweb /
treewide: use log_*_errno whenever %m is in the format string
[elogind.git] / src / core / automount.c
index f874951f4c6b5c76f9960d8b3624df06d979471f..8814d4c4feaa13b81b96a33e06a7cf056c4e136a 100644 (file)
@@ -75,7 +75,7 @@ static void repeat_unmount(const char *path) {
                         continue;
 
                 if (errno != EINVAL)
-                        log_error("Failed to unmount: %m");
+                        log_error_errno(errno, "Failed to unmount: %m");
 
                 break;
         }
@@ -301,7 +301,7 @@ static int open_dev_autofs(Manager *m) {
 
         m->dev_autofs_fd = open("/dev/autofs", O_CLOEXEC|O_RDONLY);
         if (m->dev_autofs_fd < 0) {
-                log_error("Failed to open /dev/autofs: %m");
+                log_error_errno(errno, "Failed to open /dev/autofs: %m");
                 return -errno;
         }
 
@@ -422,7 +422,7 @@ int automount_send_ready(Automount *a, int status) {
                 return ioctl_fd;
 
         if (status)
-                log_unit_debug(UNIT(a)->id, "Sending failure: %s", strerror(-status));
+                log_unit_debug_errno(UNIT(a)->id, status, "Sending failure: %m");
         else
                 log_unit_debug(UNIT(a)->id, "Sending success.");
 
@@ -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;
         }
 
@@ -770,7 +773,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo
 
                 r = set_put(a->tokens, UINT_TO_PTR(packet.v5_packet.wait_queue_token));
                 if (r < 0) {
-                        log_unit_error(UNIT(a)->id, "Failed to remember token: %s", strerror(-r));
+                        log_unit_error_errno(UNIT(a)->id, r, "Failed to remember token: %m");
                         goto fail;
                 }