aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorGravatar Miklos Szeredi <miklos@szeredi.hu>2001-11-07 14:55:16 +0000
committerGravatar Miklos Szeredi <miklos@szeredi.hu>2001-11-07 14:55:16 +0000
commitf3ea83bac4cc55033a1db39a109bbf70b87f0578 (patch)
tree1bd2348ad53ee1f06ea32edea095a0eb32b9e7d1 /example
parentc0938eafb8ea4927f21268eb7e67377c2c78a4eb (diff)
build and install fixes
Diffstat (limited to 'example')
-rw-r--r--example/.cvsignore1
-rw-r--r--example/Makefile.am2
-rw-r--r--example/fusexmp.c40
3 files changed, 37 insertions, 6 deletions
diff --git a/example/.cvsignore b/example/.cvsignore
index e440faf..bcfd8b2 100644
--- a/example/.cvsignore
+++ b/example/.cvsignore
@@ -1,3 +1,4 @@
Makefile.in
Makefile
.deps
+fusexmp
diff --git a/example/Makefile.am b/example/Makefile.am
index 0e666b5..4d89206 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -4,4 +4,4 @@ bin_PROGRAMS = fusexmp
fusexmp_SOURCES = fusexmp.c
-fusexmp_LDADD = ../lib/libfuse.a
+fusexmp_LDADD = ../lib/libfuse.a -lpthread
diff --git a/example/fusexmp.c b/example/fusexmp.c
index b00039d..4c831dc 100644
--- a/example/fusexmp.c
+++ b/example/fusexmp.c
@@ -388,22 +388,52 @@ static struct fuse_operations xmp_oper = {
int main(int argc, char *argv[])
{
int res;
- if(argc != 2) {
- fprintf(stderr, "usage: %s mount_dir\n", argv[0]);
+ int argctr;
+ char *mnt;
+ int flags;
+
+ if(argc < 2) {
+ fprintf(stderr,
+ "usage: %s [options] mount_dir\n"
+ "Options:\n"
+ " -d enable debug output\n"
+ " -s disable multithreaded operation\n",
+ argv[0]);
exit(1);
}
+ flags = FUSE_MULTITHREAD;
+ for(argctr = 1; argctr < argc && argv[argctr][0] == '-'; argctr ++) {
+ switch(argv[argctr][1]) {
+ case 'd':
+ flags |= FUSE_DEBUG;
+ break;
+
+ case 's':
+ flags &= ~FUSE_MULTITHREAD;
+ break;
+
+ default:
+ fprintf(stderr, "invalid option: %s\n", argv[argctr]);
+ exit(1);
+ }
+ }
+ if(argctr != argc - 1) {
+ fprintf(stderr, "missing or surplus argument\n");
+ exit(1);
+ }
+ mnt = argv[argctr];
+
set_signal_handlers();
atexit(cleanup);
setgroups(0, NULL);
- xmp_fuse = fuse_new(0,0);
- res = fuse_mount(xmp_fuse, argv[1]);
+ xmp_fuse = fuse_new(flags, 0);
+ res = fuse_mount(xmp_fuse, mnt);
if(res == -1)
exit(1);
fuse_set_operations(xmp_fuse, &xmp_oper);
-
fuse_loop(xmp_fuse);
return 0;