aboutsummaryrefslogtreecommitdiffstats
path: root/fusemount.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2001-10-25 14:16:17 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2001-10-25 14:16:17 +0000
commitd8ae7147bfe8f40e72ea640c6631a4b2c6f2c6c9 (patch)
treeb9cc8c9342ebf54a45184b0345a798106466a3a8 /fusemount.c
parent79b52f63303c15d4545a7464775f4b1beab8d2c9 (diff)
downloadlibfuse-d8ae7147bfe8f40e72ea640c6631a4b2c6f2c6c9.tar.gz
improvements
Diffstat (limited to 'fusemount.c')
-rw-r--r--fusemount.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/fusemount.c b/fusemount.c
index b4d3bc0..3ae2932 100644
--- a/fusemount.c
+++ b/fusemount.c
@@ -17,8 +17,30 @@
#include <sys/mount.h>
#include <mntent.h>
+static void loop(int devfd)
+{
+ int res;
+ struct fuse_param param;
+
+ while(1) {
+ res = read(devfd, &param, sizeof(param));
+ if(res == -1) {
+ perror("read");
+ exit(1);
+ }
+
+ printf("unique: %i, opcode: %i\n", param.unique, param.u.i.opcode);
+ param.u.o.result = 0;
+
+ res = write(devfd, &param, sizeof(param));
+ if(res == -1) {
+ perror("write");
+ exit(1);
+ }
+ }
+}
-int mount_fuse(const char *dev, const char *dir, int devfd)
+static int mount_fuse(const char *dev, const char *dir, int devfd)
{
int res;
const char *type;
@@ -81,7 +103,7 @@ int main(int argc, char *argv[])
mount_fuse(dev, dir, devfd);
- sleep(1000);
-
+ loop(devfd);
+
return 0;
}