static void fuse_unmount_common(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); }
static struct fuse_chan *fuse_mount_common(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_mount_compat25(mountpoint, args); if (fd == -1) return NULL; ch = fuse_kern_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_chan *fuse_mount_common(const char *mountpoint, struct fuse_args *args) { struct fuse_chan *ch; int fd = fuse_mount_compat25(mountpoint, args); if (fd == -1) return NULL; ch = fuse_kern_chan_new(fd); if (!ch) fuse_kern_unmount(mountpoint, fd); return ch; }
void fuse_unmount_compat22(const char *mountpoint) { fuse_kern_unmount(mountpoint, -1); }