OSDN Git Service

Fix crash on unmount under OSXFUSE.
authorrelan <relan@users.noreply.github.com>
Fri, 23 Aug 2013 05:49:35 +0000 (05:49 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:16 +0000 (08:26 +0300)
OSXFUSE calls fuse_exfat_fsync() for "/" which was not opened.

fuse/main.c

index e33060d..9f900ae 100644 (file)
@@ -160,9 +160,12 @@ static int fuse_exfat_fsync(const char* path, int datasync,
        int rc;
 
        exfat_debug("[%s] %s", __func__, path);
-       rc = exfat_flush_node(&ef, get_node(fi));
-       if (rc != 0)
-               return rc;
+       if (get_node(fi) != NULL)
+       {
+               rc = exfat_flush_node(&ef, get_node(fi));
+               if (rc != 0)
+                       return rc;
+       }
        rc = exfat_flush(&ef);
        if (rc != 0)
                return rc;