From: Theodore Ts'o Date: Wed, 26 Mar 2008 12:53:13 +0000 (-0400) Subject: fsck: Make -Cn work correctly where n != 0 X-Git-Tag: v1.40.9~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a16834335d745d631d6ee20eef0bdbe24e4b152d;p=thirdparty%2Fe2fsprogs.git fsck: Make -Cn work correctly where n != 0 Previously, fsck was only passing in -Cn to the first e2fsck process to start up, and enabling the progress information by sending a SIGUSR1 signal. This didn't work if the progress information was intended to go to file descriptor, since the information was never passed to e2fsck. So we now pass the progress fd in as a negative number if the progress information is intended to be initially suppressed. Addresses-Launchpad-Bug: #203323 Addresses-Sourceforge-Bug: #1926023 Signed-off-by: "Theodore Ts'o" --- diff --git a/misc/fsck.c b/misc/fsck.c index 14d7a954a..e44829ab2 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -451,13 +451,19 @@ static int execute(const char *type, const char *device, const char *mntpt, for (i=0; i flags |= FLAG_PROGRESS; + + tmp[0] = 0; + if (!progress_active()) { + snprintf(tmp, 80, "-C%d", progress_fd); + inst->flags |= FLAG_PROGRESS; + } else if (progress_fd) + snprintf(tmp, 80, "-C%d", progress_fd * -1); + if (tmp[0]) + argv[argc++] = string_copy(tmp); } }