summaryrefslogtreecommitdiffstats
path: root/daemon/command.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-06-09 10:10:50 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-06-13 14:12:28 +0100
commit00a412ac4f2276462b550f1b68cc6751ed6765f8 (patch)
treebcd6c1a5938c91dbaf6b1079bac74ec1e95526e2 /daemon/command.c
parentf0bea00cc5ccbcb275d74ed8b95a54b991a51503 (diff)
downloadlibguestfs-00a412ac4f2276462b550f1b68cc6751ed6765f8.tar.gz
libguestfs-00a412ac4f2276462b550f1b68cc6751ed6765f8.tar.xz
libguestfs-00a412ac4f2276462b550f1b68cc6751ed6765f8.zip
daemon: Keep Coverity happy by ignoring some return values.
(cherry picked from commit f5096dd546ac43c7288b3ab7aec1562f070f78f6)
Diffstat (limited to 'daemon/command.c')
-rw-r--r--daemon/command.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/daemon/command.c b/daemon/command.c
index 5a194a4e..ef236957 100644
--- a/daemon/command.c
+++ b/daemon/command.c
@@ -26,6 +26,14 @@
#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);