diff options
author | Reuben Thomas <rrt@sc3d.org> | 2007-12-15 16:31:26 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2007-12-15 16:31:26 +0000 |
commit | 0747d9f6f108aee1eeebde0e2ad2e3ba0c2f400c (patch) | |
tree | a372ec71ab5e5db04f5dd9d3ffebeb4c22d8c8c5 /plpfuse | |
parent | 722003826888760609a62e3015917cb46ada6fc9 (diff) | |
download | plptools-0747d9f6f108aee1eeebde0e2ad2e3ba0c2f400c.tar.gz plptools-0747d9f6f108aee1eeebde0e2ad2e3ba0c2f400c.tar.bz2 plptools-0747d9f6f108aee1eeebde0e2ad2e3ba0c2f400c.zip |
Make plpfuse daemonize if -f not given.
Diffstat (limited to 'plpfuse')
-rw-r--r-- | plpfuse/main.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plpfuse/main.cc b/plpfuse/main.cc index 8689cae..769577c 100644 --- a/plpfuse/main.cc +++ b/plpfuse/main.cc @@ -320,13 +320,15 @@ int fuse(int argc, char *argv[]) struct fuse_args args = FUSE_ARGS_INIT(argc, argv); struct fuse_chan *ch; char *mountpoint; - int err = -1; + int err = -1, foreground; - if (fuse_parse_cmdline(&args, &mountpoint, NULL, NULL) != -1 && + if (fuse_parse_cmdline(&args, &mountpoint, NULL, &foreground) != -1 && (ch = fuse_mount(mountpoint, &args)) != NULL) { - struct fuse *fp = fuse_new(ch, &args, &plp_oper, sizeof(plp_oper), NULL); - if (fp != NULL) - err = fuse_loop(fp); + if (fuse_daemonize(foreground) != -1) { + struct fuse *fp = fuse_new(ch, &args, &plp_oper, sizeof(plp_oper), NULL); + if (fp != NULL) + err = fuse_loop(fp); + } fuse_unmount(mountpoint, ch); } fuse_opt_free_args(&args); |