[Libguestfs] [PATCH] Fix a bug in e2fsck execution code

Nikos Skalkotos skalkoto at grnet.gr
Wed Feb 18 13:59:48 UTC 2015


Use commandrvf() instead of commandvf() to execute e2fsck. A non-zero
exit status does not always indicate a failure.

Signed-off-by: Nikos Skalkotos <skalkoto at grnet.gr>
---
 daemon/ext2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/daemon/ext2.c b/daemon/ext2.c
index 65ddae6..8ef6d5f 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -296,9 +296,9 @@ do_e2fsck (const char *device,
   ADD_ARG (argv, i, device);
   ADD_ARG (argv, i, NULL);
 
-  r = commandvf (NULL, &err,
-                 COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
-                 argv);
+  r = commandrvf (NULL, &err,
+                  COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
+                  argv);
   /* 0 = no errors, 1 = errors corrected.
    *
    * >= 4 means uncorrected or other errors.
-- 
1.9.1




More information about the Libguestfs mailing list