Nikos Skalkotos
2015-Feb-18 13:59 UTC
[Libguestfs] [PATCH] Fix a bug in e2fsck execution code
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@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
Richard W.M. Jones
2015-Feb-18 14:43 UTC
Re: [Libguestfs] [PATCH] Fix a bug in e2fsck execution code
On Wed, Feb 18, 2015 at 03:59:48PM +0200, Nikos Skalkotos wrote:> 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@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.Oops. I will push this in a moment, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Maybe Matching Threads
- [PATCH] daemon: improve internal commandrvf
- [PATCH] daemon: improve debugging for "stdout on stderr" flag
- [PATCH v3 2/6] daemon: Split out command() functions and CLEANUP_* macros into separate files.
- [PATCH] ntfsresize: Capture errors sent to stdout (RHBZ#1166618).
- [PATCH] daemon: fold xfs_admin stdout to stderr