From: Richard W.M. Jones <rjones@redhat.com>
Date: Fri, 9 Dec 2011 15:30:23 +0000 (+0000)
Subject: fuse: Return EXIT_FAILURE if fuse_main fails.
X-Git-Tag: 1.15.11~1
X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=ae45cee728039d7724fc73e5ffb2550c8054d268;p=libguestfs.git

fuse: Return EXIT_FAILURE if fuse_main fails.

fuse_main can return any non-zero value on error.  In particular on
certain sorts of error such as unsupported -o options it returns 1
(not -1).

Therefore make sure any non-zero return is turned into EXIT_FAILURE.

(Thanks Pádraig Brady)
---

diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index 54ed947..7782be1 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -1227,5 +1227,5 @@ main (int argc, char *argv[])
   guestfs_close (g);
   free_dir_caches ();
 
-  exit (r == -1 ? 1 : 0);
+  exit (r == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }