From d8ae7147bfe8f40e72ea640c6631a4b2c6f2c6c9 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 25 Oct 2001 14:16:17 +0000 Subject: improvements --- fusemount.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'fusemount.c') diff --git a/fusemount.c b/fusemount.c index b4d3bc0..3ae2932 100644 --- a/fusemount.c +++ b/fusemount.c @@ -17,8 +17,30 @@ #include #include +static void loop(int devfd) +{ + int res; + struct fuse_param param; + + while(1) { + res = read(devfd, ¶m, 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, ¶m, 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; } -- cgit v1.2.3