From 95da860d29a54c6dc21683a34edefead597e3bbc Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 6 Jan 2006 18:29:40 +0000 Subject: fix --- example/hello_ll.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'example/hello_ll.c') 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 + Copyright (C) 2001-2006 Miklos Szeredi 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; } -- cgit v1.2.3