diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-02 10:26:40 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-02 10:51:34 -0700 |
commit | 50f5255a44870863e4a9b6bcb7a62b5319fefd62 (patch) | |
tree | f2612633cfae824810dd8c0c86d7d0beb5cfcdf1 /lib/helper.c | |
parent | 1ac9551d9a0a7abdce3dd31dad808c89e0467823 (diff) |
Introduce separate mount/umount functions for low-level API.
Diffstat (limited to 'lib/helper.c')
-rw-r--r-- | lib/helper.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/lib/helper.c b/lib/helper.c index 6a55269..cd1a54b 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -227,41 +227,6 @@ int fuse_daemonize(int foreground) return 0; } -struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args) -{ - struct fuse_chan *ch; - int fd; - - /* - * Make sure file descriptors 0, 1 and 2 are open, otherwise chaos - * would ensue. - */ - do { - fd = open("/dev/null", O_RDWR); - if (fd > 2) - close(fd); - } while (fd >= 0 && fd <= 2); - - fd = fuse_kern_mount(mountpoint, args); - if (fd == -1) - return NULL; - - ch = fuse_chan_new(fd); - if (!ch) - fuse_kern_unmount(mountpoint, fd); - - return ch; -} - -void fuse_unmount(const char *mountpoint, struct fuse_chan *ch) -{ - if (mountpoint) { - int fd = ch ? fuse_chan_clearfd(ch) : -1; - fuse_kern_unmount(mountpoint, fd); - fuse_chan_put(ch); - } -} - static struct fuse *fuse_setup(int argc, char *argv[], const struct fuse_operations *op, size_t op_size, char **mountpoint, int *multithreaded, void *user_data) |