X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fautomount.c;h=f7954871318bf44ed6a963d9dd76f086e973c417;hb=a2c0e528b8b5ba370527db279605e4e4135689c1;hp=3f34a2895f2c11186700b9faeec0a917f5ebaad7;hpb=31938a8560a664c32a9d72f1fc2d4347b232e6e9;p=elogind.git diff --git a/src/core/automount.c b/src/core/automount.c index 3f34a2895..f79548713 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -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; } @@ -300,10 +300,8 @@ static int open_dev_autofs(Manager *m) { label_fix("/dev/autofs", false, false); 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"); - return -errno; - } + if (m->dev_autofs_fd < 0) + return log_error_errno(errno, "Failed to open /dev/autofs: %m"); init_autofs_dev_ioctl(¶m); if (ioctl(m->dev_autofs_fd, AUTOFS_DEV_IOCTL_VERSION, ¶m) < 0) { @@ -744,7 +742,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; }