diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-01-06 18:29:40 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2006-01-06 18:29:40 +0000 |
commit | 95da860d29a54c6dc21683a34edefead597e3bbc (patch) | |
tree | ac1df7de0b985741e97169b2e3233ab1267cfdd5 /example/hello_ll.c | |
parent | 1f6a5346406a620071ae6a659d5a75cd5220a128 (diff) |
fix
Diffstat (limited to 'example/hello_ll.c')
-rw-r--r-- | example/hello_ll.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/example/hello_ll.c b/example/hello_ll.c index d365771..7682f4e 100644 --- a/example/hello_ll.c +++ b/example/hello_ll.c @@ -1,6 +1,6 @@ /* FUSE: Filesystem in Userspace - Copyright (C) 2001-2005 Miklos Szeredi <miklos@szeredi.hu> + Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> This program can be distributed under the terms of the GNU GPL. See the file COPYING. @@ -146,32 +146,32 @@ static struct fuse_lowlevel_ops hello_ll_oper = { int main(int argc, char *argv[]) { - const char *mountpoint; + struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + char *mountpoint; int err = -1; int fd; - if (argc != 2) { - fprintf(stderr, "usage: %s mountpoint\n", argv[0]); - return 1; - } - mountpoint = argv[1]; - fd = fuse_mount(mountpoint, NULL); - if (fd != -1) { + if (fuse_parse_cmdline(&args, &mountpoint, NULL, NULL) != -1 && + (fd = fuse_mount(mountpoint, &args)) != -1) { struct fuse_session *se; - se = fuse_lowlevel_new("debug", &hello_ll_oper, sizeof(hello_ll_oper), + se = fuse_lowlevel_new(&args, &hello_ll_oper, sizeof(hello_ll_oper), NULL); if (se != NULL) { - struct fuse_chan *ch = fuse_kern_chan_new(fd); - if (ch != NULL) { - fuse_session_add_chan(se, ch); - err = fuse_session_loop(se); + if (fuse_set_signal_handlers(se) != -1) { + struct fuse_chan *ch = fuse_kern_chan_new(fd); + if (ch != NULL) { + fuse_session_add_chan(se, ch); + err = fuse_session_loop(se); + } + fuse_remove_signal_handlers(se); } fuse_session_destroy(se); } close(fd); } fuse_unmount(mountpoint); + fuse_opt_free_args(&args); return err ? 1 : 0; } |