[Pkg-libvirt-commits] [libguestfs] 280/384: fuse: Alternatives for Linux-specific commands

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 16:57:54 UTC 2015


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

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 5f67d23cf549dbd036a50bdea5ac883f274fe0c4
Author: Margaret Lewicka <margaret at meaningless.name>
Date:   Fri Feb 13 21:26:14 2015 +0000

    fuse: Alternatives for Linux-specific commands
    
    * fusermount is Linux-only; on BSD and OS X umount should be used
    * fuser has no -v flag on BSD/OSX, and -c is the
      POSIX-compatible equivalent of -m
    * Does not solve the lack of pretty output of fuser -v, but does make it
      work on Mac OS X.
---
 fuse/guestunmount.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fuse/guestunmount.c b/fuse/guestunmount.c
index 3df481b..94c3ec7 100644
--- a/fuse/guestunmount.c
+++ b/fuse/guestunmount.c
@@ -257,7 +257,12 @@ do_fusermount (const char *mountpoint, char **error_rtn)
     /* We have to parse error messages from fusermount, so ... */
     setenv ("LC_ALL", "C", 1);
 
+#ifdef __linux__
     execlp ("fusermount", "fusermount", "-u", mountpoint, NULL);
+#else
+    /* use umount where fusermount is not available */
+    execlp ("umount", "umount", mountpoint, NULL);
+#endif
     perror ("exec");
     _exit (EXIT_FAILURE);
   }
@@ -334,7 +339,11 @@ do_fuser (const char *mountpoint)
   }
 
   if (pid == 0) {               /* Child - run /sbin/fuser. */
+#ifdef __linux__
     execlp ("/sbin/fuser", "fuser", "-v", "-m", mountpoint, NULL);
+#else
+    execlp ("/sbin/fuser", "fuser", "-c", mountpoint, NULL);
+#endif
     _exit (EXIT_FAILURE);
   }
 

-- 
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