aboutsummaryrefslogtreecommitdiff
path: root/lib/mount.c
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2006-03-17 15:05:40 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2006-03-17 15:05:40 +0000
commit6f385414b27e929bd14435ea8342cde4bae0ef8d (patch)
treec5a557fa053ebd9d96331f9d620d96a80a1282bd /lib/mount.c
parent9db31dc1cff5ae2e854649f039f319d45eb58cf3 (diff)
fix
Diffstat (limited to 'lib/mount.c')
-rw-r--r--lib/mount.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/lib/mount.c b/lib/mount.c
index 5c568e9..045a4a6 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -6,9 +6,8 @@
See the file COPYING.LIB.
*/
-#include "fuse.h"
+#include "fuse_i.h"
#include "fuse_opt.h"
-#include "fuse_compat.h"
#include <stdio.h>
#include <stdlib.h>
@@ -167,28 +166,26 @@ static int receive_fd(int fd)
return *(int*)CMSG_DATA(cmsg);
}
-void fuse_unmount_compat22(const char *mountpoint)
-{
- fuse_unmount(mountpoint, -1);
-}
-
-void fuse_unmount(const char *mountpoint, int fd)
+void fuse_kern_unmount(const char *mountpoint, int fd)
{
const char *mountprog = FUSERMOUNT_PROG;
- struct pollfd pfd;
- int res;
int pid;
if (!mountpoint)
return;
- pfd.fd = fd;
- pfd.events = 0;
- res = poll(&pfd, 1, 0);
- /* If file poll returns POLLERR on the device file descriptor,
- then the filesystem is already unmounted */
- if (res == 1 && (pfd.revents & POLLERR))
- return;
+ if (fd != -1) {
+ int res;
+ struct pollfd pfd;
+
+ pfd.fd = fd;
+ pfd.events = 0;
+ res = poll(&pfd, 1, 0);
+ /* If file poll returns POLLERR on the device file descriptor,
+ then the filesystem is already unmounted */
+ if (res == 1 && (pfd.revents & POLLERR))
+ return;
+ }
#ifdef HAVE_FORK
pid = fork();
@@ -216,6 +213,11 @@ void fuse_unmount(const char *mountpoint, int fd)
waitpid(pid, NULL, 0);
}
+void fuse_unmount_compat22(const char *mountpoint)
+{
+ fuse_kern_unmount(mountpoint, -1);
+}
+
int fuse_mount_compat22(const char *mountpoint, const char *opts)
{
const char *mountprog = FUSERMOUNT_PROG;
@@ -277,7 +279,7 @@ int fuse_mount_compat22(const char *mountpoint, const char *opts)
return rv;
}
-int fuse_mount(const char *mountpoint, struct fuse_args *args)
+int fuse_kern_mount(const char *mountpoint, struct fuse_args *args)
{
struct mount_opts mo;
int res = -1;
@@ -301,12 +303,5 @@ int fuse_mount(const char *mountpoint, struct fuse_args *args)
return res;
}
-int fuse_mount_compat1(const char *mountpoint, const char *args[])
-{
- /* just ignore mount args for now */
- (void) args;
- return fuse_mount_compat22(mountpoint, NULL);
-}
-
__asm__(".symver fuse_mount_compat22,fuse_mount@FUSE_2.2");
__asm__(".symver fuse_unmount_compat22,fuse_unmount@FUSE_2.2");