diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2001-11-16 13:31:14 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2001-11-16 13:31:14 +0000 |
commit | 680a69a8be8b7dd9bf1beae4e48e927d0fb1cd7f (patch) | |
tree | e3c27e1c3144210621cd30a7f7c3d762ce6b5249 /example/fusexmp.c | |
parent | fff56ab1242e3ad7cddf15e7e981da55d06c4da5 (diff) | |
download | libfuse-680a69a8be8b7dd9bf1beae4e48e927d0fb1cd7f.tar.gz |
threading fixes
Diffstat (limited to 'example/fusexmp.c')
-rw-r--r-- | example/fusexmp.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c index aeb4f88..2bcdb37 100644 --- a/example/fusexmp.c +++ b/example/fusexmp.c @@ -231,8 +231,32 @@ static int xmp_write(const char *path, const char *buf, size_t size, return res; } + +static struct fuse_operations xmp_oper = { + getattr: xmp_getattr, + readlink: xmp_readlink, + getdir: xmp_getdir, + mknod: xmp_mknod, + mkdir: xmp_mkdir, + symlink: xmp_symlink, + unlink: xmp_unlink, + rmdir: xmp_rmdir, + rename: xmp_rename, + link: xmp_link, + chmod: xmp_chmod, + chown: xmp_chown, + truncate: xmp_truncate, + utime: xmp_utime, + open: xmp_open, + read: xmp_read, + write: xmp_write, +}; + + static void exit_handler() { + close(0); + system(unmount_cmd); exit(0); } @@ -260,32 +284,6 @@ static void set_signal_handlers() } } -static struct fuse_operations xmp_oper = { - getattr: xmp_getattr, - readlink: xmp_readlink, - getdir: xmp_getdir, - mknod: xmp_mknod, - mkdir: xmp_mkdir, - symlink: xmp_symlink, - unlink: xmp_unlink, - rmdir: xmp_rmdir, - rename: xmp_rename, - link: xmp_link, - chmod: xmp_chmod, - chown: xmp_chown, - truncate: xmp_truncate, - utime: xmp_utime, - open: xmp_open, - read: xmp_read, - write: xmp_write, -}; - -static void cleanup() -{ - close(0); - system(unmount_cmd); -} - int main(int argc, char *argv[]) { int argctr; @@ -307,7 +305,6 @@ int main(int argc, char *argv[]) unmount_cmd = argv[argctr++]; set_signal_handlers(); - atexit(cleanup); flags = 0; multithreaded = 1; |