diff options
Diffstat (limited to 'lib/helper.c')
-rw-r--r-- | lib/helper.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/helper.c b/lib/helper.c index 8ee66df..204bb22 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -235,7 +235,7 @@ struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args) if (fd == -1) return NULL; - ch = fuse_kern_chan_new(fd); + ch = fuse_chan_new(fd); if (!ch) fuse_kern_unmount(mountpoint, fd); @@ -244,10 +244,12 @@ struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args) void fuse_unmount(const char *mountpoint, struct fuse_chan *ch) { - int fd = ch ? fuse_chan_fd(ch) : -1; - fuse_kern_unmount(mountpoint, fd); - if (ch) - fuse_chan_destroy(ch); + if (mountpoint) { + int fd = ch ? fuse_chan_clearfd(ch) : -1; + fuse_kern_unmount(mountpoint, fd); + if (ch) + fuse_chan_destroy(ch); + } } static struct fuse *fuse_setup(int argc, char *argv[], @@ -297,7 +299,7 @@ err_free: static void fuse_teardown(struct fuse *fuse, char *mountpoint) { struct fuse_session *se = fuse_get_session(fuse); - struct fuse_chan *ch = fuse_session_next_chan(se, NULL); + struct fuse_chan *ch = fuse_session_chan(se); fuse_remove_signal_handlers(se); fuse_unmount(mountpoint, ch); fuse_destroy(fuse); |