Many files:
unix.c: Add support for calculating a progress bar if the -C0 option
is given. The function e2fsck_clear_progbar() clears the progress bar
and must be called before any message is issued. SIGUSR1 will enable
the progress bar, and SIGUSR2 will disable the progress bar. This is
used by fsck to handle parallel filesystem checks. Also, set the
device_name from the filesystem label if it is available.
e2fsck.h: Add new flags E2F_FLAG_PROG_BAR and E2F_FLAG_PROG_SUPRESS.
Add new field in the e2fsck structure which contains the last tenth of
a percent printed for the user.
message.c (print_e2fsck_message): Add call to e2fsck_clear_progbar().
pass1.c (e2fsck_pass1):
pass2.c (e2fsck_pass2):
pass3.c (e2fsck_pass3):
pass4.c (e2fsck_pass4):
pass5.c (e2fsck_pass5): Add call to e2fsck_clear_progbar when printing
the resource tracking information.
pass5.c (check_block_bitmaps, check_inode_bitmaps): If there is an
error in the bitmaps, suppress printing the progress bar using the
suppression flag for the remainder of the check, in order to clean up
the display.
diff --git a/e2fsck/e2fsck.8.in b/e2fsck/e2fsck.8.in
index 41e6dc8..df4e6da 100644
--- a/e2fsck/e2fsck.8.in
+++ b/e2fsck/e2fsck.8.in
@@ -78,14 +78,13 @@
.B e2fsck
to write completion information to the specified file descriptor
so that the progress of the filesystem
-check can be monitored. This option is typically used by programs which are
-executing
-.BR e2fsck ,
-although -C 0 is a special case which will output a spinning
-character which can be useful for users who want to have something to watch
-while
+check can be monitored. This option is typically used by programs
+which are running
+.BR e2fsck .
+If the file descriptor specified is 0,
.B e2fsck
-goes about its business.
+will print a completion bar as it goes about its business. This requires
+that e2fsck is running on a video console or terminal.
.TP
.I -d
Print debugging output (useless unless you are debugging
@@ -186,6 +185,21 @@
.br
\ 128\ \-\ Shared library error
.br
+.SH SIGNALS
+The following signals have the following effect when sent to
+.BR e2fsck .
+.TP
+.B SIGUSR1
+This signal causes
+.B e2fsck
+to start displaying a completion bar. (See discussion of the
+.I -C
+option.)
+.TP
+.B SIGUSR2
+This signal causes
+.B e2fsck
+to stop displaying a completion bar.
.SH REPORTING BUGS
Almost any piece of software will have bugs. If you manage to find a
filesystem which causes