コード例 #1
0
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);
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: helper.c プロジェクト: ProjectRune/libfuse
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);
	}
}
コード例 #4
0
ファイル: helper.c プロジェクト: rolivia/OS-Project
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;
}
コード例 #5
0
ファイル: mount.c プロジェクト: alhazred/illumos-sshfs
void fuse_unmount_compat22(const char *mountpoint)
{
    fuse_kern_unmount(mountpoint, -1);
}