From 9703a8adb5c2ef16fcbf0e92189494a5a3438b06 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 May 2016 16:01:39 +0200 Subject: [PATCH] automount: add debug message when we get notified about mount state changes --- src/core/automount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/automount.c b/src/core/automount.c index 464d6a70c05..d2386d04f7a 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -408,7 +408,7 @@ static int autofs_send_ready(int dev_autofs_fd, int ioctl_fd, uint32_t token, in init_autofs_dev_ioctl(¶m); param.ioctlfd = ioctl_fd; - if (status) { + if (status != 0) { param.fail.token = token; param.fail.status = status; } else @@ -435,7 +435,7 @@ static int automount_send_ready(Automount *a, Set *tokens, int status) { if (ioctl_fd < 0) return ioctl_fd; - if (status) + if (status != 0) log_unit_debug_errno(UNIT(a), status, "Sending failure: %m"); else log_unit_debug(UNIT(a), "Sending success."); @@ -469,7 +469,10 @@ int automount_update_mount(Automount *a, MountState old_state, MountState state) assert(a); + log_unit_debug(UNIT(a), "Got notified about mount unit state change %s → %s", mount_state_to_string(old_state), mount_state_to_string(state)); + switch (state) { + case MOUNT_MOUNTED: case MOUNT_REMOUNTING: automount_send_ready(a, a->tokens, 0);