static int fuse_exfat_fsync(const char* path, int datasync,
struct fuse_file_info *fi)
{
+ int rc;
+
exfat_debug("[%s] %s", __func__, path);
- exfat_flush_node(&ef, get_node(fi));
- exfat_flush(&ef);
+ 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;
return exfat_fsync(ef.dev);
}