Added debug logging to chmod
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 25 Oct 2016 04:17:54 +0000 (21:17 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 25 Oct 2016 04:20:09 +0000 (21:20 -0700)
lib/fuse.c

index 692f9c537c4951c972c0c48009bf3df8db9aac54..ab5a593e85fff9bbc29d993dfd9e5b1691707c6b 100644 (file)
@@ -2633,8 +2633,15 @@ int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode,
                  struct fuse_file_info *fi)
 {
        fuse_get_context()->private_data = fs->user_data;
-       if (fs->op.chmod)
+       if (fs->op.chmod) {
+               if (fs->debug) {
+                       char buf[10];
+                       fprintf(stderr, "chmod[%s] %s %llo\n",
+                               file_info_string(fi, buf, sizeof(buf)),
+                               path, (unsigned long long) mode);
+               }
                return fs->op.chmod(path, mode, fi);
+       }
        else
                return -ENOSYS;
 }