mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
daemon: Fold stdout on stderr when running e2fsck.
User Phill Bandelow noted that virt-resize fails with an e2fsck error on a host where the system clock had been accidentally set in the past. Unfortunately this was hard to diagnose because guestfsd 'ate' the stdout of the e2fsck program. I have verified by code inspection that e2fsck prints messages on stdout. Thus this changes the daemon to fold stdout and stderr together so we get to see all error messages from e2fsck when it fails.
This commit is contained in:
@@ -171,7 +171,9 @@ if_not_mounted_run_e2fsck (const char *device)
|
||||
return -1;
|
||||
|
||||
if (!mounted) {
|
||||
r = command (NULL, &err, str_e2fsck, "-fy", device, NULL);
|
||||
r = commandf (NULL, &err,
|
||||
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
|
||||
str_e2fsck, "-fy", device, NULL);
|
||||
if (r == -1) {
|
||||
reply_with_error ("%s", err);
|
||||
free (err);
|
||||
@@ -291,7 +293,9 @@ do_e2fsck (const char *device,
|
||||
ADD_ARG (argv, i, device);
|
||||
ADD_ARG (argv, i, NULL);
|
||||
|
||||
r = commandv (NULL, &err, argv);
|
||||
r = commandvf (NULL, &err,
|
||||
COMMAND_FLAG_FOLD_STDOUT_ON_STDERR,
|
||||
argv);
|
||||
/* 0 = no errors, 1 = errors corrected.
|
||||
*
|
||||
* >= 4 means uncorrected or other errors.
|
||||
|
||||
Reference in New Issue
Block a user