automount: add debug message when we get notified about mount state changes
authorLennart Poettering <lennart@poettering.net>
Mon, 2 May 2016 14:01:39 +0000 (16:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 May 2016 14:01:39 +0000 (16:01 +0200)
src/core/automount.c

index 464d6a7..d2386d0 100644 (file)
@@ -408,7 +408,7 @@ static int autofs_send_ready(int dev_autofs_fd, int ioctl_fd, uint32_t token, in
         init_autofs_dev_ioctl(&param);
         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);