fix parametars is there is no debug option
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 23 May 2006 14:28:34 +0000 (14:28 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 23 May 2006 14:28:34 +0000 (14:28 +0000)
git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@87 6e4b0b00-1209-0410-87b2-b275959b5705

Fuse.xs

diff --git a/Fuse.xs b/Fuse.xs
index e0bcfdc..c5d0653 100644 (file)
--- a/Fuse.xs
+++ b/Fuse.xs
@@ -942,13 +942,18 @@ perl_fuse_main(...)
        fd = fuse_mount(mountpoint,&margs);
        fuse_opt_free_args(&margs);        
        if(fd < 0)
-               croak("could not mount fuse filesystem!");
-        if (debug &&
-           (fuse_opt_add_arg(&fargs, "") == -1 ||
-            fuse_opt_add_arg(&fargs, "-d") == -1)) {
-               fuse_opt_free_args(&fargs);
-               croak("out of memory\n");
+               croak("could not mount fuse filesystem!\n");
+        if (debug) {
+               if ( fuse_opt_add_arg(&fargs, "") == -1 ||
+                       fuse_opt_add_arg(&fargs, "-d") == -1) {
+                       fuse_opt_free_args(&fargs);
+                       croak("out of memory\n");
+               }
+       } else {
+               if (fuse_opt_add_arg(&fargs, "") == -1)
+                       croak("out of memory\n");
        }
+
        if(threaded) {
                fuse_loop_mt(fuse_new(fd,&fargs,&fops,sizeof(fops)/sizeof(void*)));
        } else