[Pkg-libvirt-commits] [libguestfs] 09/21: fuse: guestunmount: Make the -v (verbose) option do something useful.

Hilko Bengen bengen at moszumanska.debian.org
Sun May 3 21:27:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 0bce39a3371c9500952c982d004816d12e8642d8
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu Apr 23 19:02:41 2015 +0100

    fuse: guestunmount: Make the -v (verbose) option do something useful.
    
    guestunmount had a -v / --verbose option, but it didn't change the
    behaviour of the program in any way.
    
    Make it print the invocations of the underlying fusermount program.
    
    (cherry picked from commit 6dee5a4152a1e8a1b82f18c1f393dfc4ec89739e)
---
 fuse/guestunmount.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fuse/guestunmount.c b/fuse/guestunmount.c
index 94c3ec7..2c67f54 100644
--- a/fuse/guestunmount.c
+++ b/fuse/guestunmount.c
@@ -242,6 +242,10 @@ do_fusermount (const char *mountpoint, char **error_rtn)
     exit (EXIT_FAILURE);
   }
 
+  if (verbose)
+    fprintf (stderr, "%s: running: fusermount -u %s\n",
+             guestfs___program_name, mountpoint);
+
   pid = fork ();
   if (pid == -1) {
     perror ("fork");
@@ -316,10 +320,17 @@ do_fusermount (const char *mountpoint, char **error_rtn)
   }
 
   if (!WIFEXITED (r) || WEXITSTATUS (r) != 0) {
+    if (verbose)
+      fprintf (stderr, "%s\n", buf);
+
     *error_rtn = buf;
     return 1;                   /* fusermount or exec failed */
   }
 
+  if (verbose)
+    fprintf (stderr, "%s: fusermount successful\n",
+             guestfs___program_name);
+
   free (buf);
   return 0;                     /* fusermount successful */
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list