example/passthrough.c: add debugging code for issue #157.
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 25 May 2017 19:26:52 +0000 (12:26 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Thu, 25 May 2017 19:26:52 +0000 (12:26 -0700)
example/passthrough.c

index 0c635ca62d2363fda0b9df4a555764ea983c3a03..e7dbb521aa90dcbb1a6b26a7df2e45bd700fbfc3 100644 (file)
@@ -74,9 +74,16 @@ static int xmp_getattr(const char *path, struct stat *stbuf,
        int res;
 
        res = lstat(path, stbuf);
-       if (res == -1)
-               return -errno;
+       if (res == -1) {
+               /* Temporary debugging aid for issue #157 */
+               res = errno;
+               printf("xmp_getattr(%s) --> %s\n", path,
+                      strerror(res));
+               return -res;
+       }
 
+       printf("xmp_getattr(%s) --> ino %d, nlink %d\n", path,
+              (int) stbuf->st_ino, (int) stbuf->st_nlink);
        return 0;
 }