#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)
{
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);
#include "actions.h"
#include "optgroups.h"
+#include "ignore-value.h"
+
/* Confirmed this is true for Linux swap partitions from the Linux sources. */
#define SWAP_LABEL_MAX 16
int av;
/* Ignore return code - mkswap --help *will* fail. */
- command (NULL, &err, "mkswap", "--help", NULL);
+ ignore_value (command (NULL, &err, "mkswap", "--help", NULL));
av = strstr (err, "-U") != NULL;
free (err);