diff --git a/fuse_pascal.cpp b/fuse_pascal.cpp index c5aebbf..be11a50 100644 --- a/fuse_pascal.cpp +++ b/fuse_pascal.cpp @@ -152,14 +152,16 @@ bool make_mount_dir(std::string name, std::string &path) int main(int argc, char **argv) { extern void init_ops(fuse_lowlevel_ops *ops); - struct options options = { 0 }; + struct options options; - struct fuse_args args = FUSE_ARGS_INIT(argc, argv); - struct fuse_chan *ch; - char *mountpoint = NULL; - int err = -1; - std::string mountPath; - unsigned format; + std::memset(&options, 0, sizeof(options)); + + struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + struct fuse_chan *ch; + char *mountpoint = NULL; + int err = -1; + std::string mountPath; + unsigned format = 0; int foreground = false; int multithread = false; @@ -305,4 +307,4 @@ int main(int argc, char **argv) return err ? 1 : 0; -} \ No newline at end of file +} diff --git a/fuse_pascal_ops.cpp b/fuse_pascal_ops.cpp index 9721747..5eecbe7 100644 --- a/fuse_pascal_ops.cpp +++ b/fuse_pascal_ops.cpp @@ -1,14 +1,17 @@ +#ifdef __APPLE__ #define __FreeBSD__ 10 #define __DARWIN_64_BIT_INO_T 1 -#define _FILE_OFFSET_BITS 64 +#endif +#define _FILE_OFFSET_BITS 64 #define FUSE_USE_VERSION 27 #include #include #include #include +#include #include #include @@ -45,6 +48,10 @@ #define DEBUGNAME() \ if (0) { std::fprintf(stderr, "%s\n", __func__); } +// linux doesn't have ENOATTR. +#ifndef ENOATTR +#define ENOATTR ENOENT +#endif using namespace Pascal;