X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fcommand.c;h=ef2369576bf1f5a6ea04af99509a5d645b5e13be;hp=5e870673903e39c9939d4e4afed30dfc338ad645;hb=f5096dd546ac43c7288b3ab7aec1562f070f78f6;hpb=5922d7084d6b43f0a1a15b664c7082dfeaf584d0 diff --git a/daemon/command.c b/daemon/command.c index 5e87067..ef23695 100644 --- a/daemon/command.c +++ b/daemon/command.c @@ -22,10 +22,18 @@ #include #include -#include "../src/guestfs_protocol.h" +#include "guestfs_protocol.h" #include "daemon.h" #include "actions.h" +#include "ignore-value.h" + +static inline void +umount_ignore_fail (const char *path) +{ + ignore_value (command (NULL, NULL, "umount", path, NULL)); +} + char * do_command (char *const *argv) { @@ -88,11 +96,11 @@ do_command (char *const *argv) r = commandv (&out, &err, (const char * const *) argv); CHROOT_OUT; - if (sys_ok) command (NULL, NULL, "umount", sysroot_sys, NULL); - if (selinux_ok) command (NULL, NULL, "umount", sysroot_selinux, NULL); - if (proc_ok) command (NULL, NULL, "umount", sysroot_proc, NULL); - if (dev_pts_ok) command (NULL, NULL, "umount", sysroot_dev_pts, NULL); - if (dev_ok) command (NULL, NULL, "umount", sysroot_dev, NULL); + if (sys_ok) umount_ignore_fail (sysroot_sys); + if (selinux_ok) umount_ignore_fail (sysroot_selinux); + if (proc_ok) umount_ignore_fail (sysroot_proc); + if (dev_pts_ok) umount_ignore_fail (sysroot_dev_pts); + if (dev_ok) umount_ignore_fail (sysroot_dev); free (sysroot_dev); free (sysroot_dev_pts);