return 0;
}
+#ifdef __APPLE__
+static int fuse_exfat_chmod(const char* path, mode_t mode)
+{
+ exfat_debug("[fuse_exfat_chmod] %s 0%ho", path, mode);
+ /* make OS X utilities happy */
+ return 0;
+}
+#endif
+
static int fuse_exfat_statfs(const char* path, struct statvfs* sfs)
{
sfs->f_bsize = CLUSTER_SIZE(*ef.sb);
.mkdir = fuse_exfat_mkdir,
.rename = fuse_exfat_rename,
.utimens = fuse_exfat_utimens,
+#ifdef __APPLE__
+ .chmod = fuse_exfat_chmod,
+#endif
.statfs = fuse_exfat_statfs,
.destroy = fuse_exfat_destroy,
};
}
/* exit session on HUP, TERM and INT signals and ignore PIPE signal */
- if (fuse_set_signal_handlers(fuse_get_session(fh)))
+ if (fuse_set_signal_handlers(fuse_get_session(fh)) != 0)
{
fuse_unmount(mount_point, fc);
fuse_destroy(fh);
exfat_unmount(&ef);
+ exfat_error("failed to set signal handlers");
return 1;
}
- /* go to background unless "-d" option is passed */
- fuse_daemonize(debug);
-
- /* FUSE main loop */
- fuse_loop(fh);
+ /* go to background (unless "-d" option is passed) and run FUSE
+ main loop */
+ if (fuse_daemonize(debug) == 0)
+ {
+ if (fuse_loop(fh) != 0)
+ exfat_error("FUSE loop failure");
+ }
+ else
+ exfat_error("failed to daemonize");
- /* it's quite illogical but fuse_unmount() must be called BEFORE
- fuse_destroy() */
+ fuse_remove_signal_handlers(fuse_get_session(fh));
+ /* note that fuse_unmount() must be called BEFORE fuse_destroy() */
fuse_unmount(mount_point, fc);
fuse_destroy(fh);
return 0;