summaryrefslogtreecommitdiff
path: root/src/fsck/fsck.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-03 00:02:31 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-03-03 10:19:19 -0500
commit576a13eaf6491fdbebc817ef613963ac24cfb6b8 (patch)
treecbc75d68d26d8a6ea93194884e81e0d5005ff513 /src/fsck/fsck.c
parentd873e8778c92014c02a9122852758b436fa95c0e (diff)
fsck: remove unnecessary check
gcc was complaining that progress_rc might be used uninitalized. But it was actually always set, because the condition was always satisfied. Remove the condition.
Diffstat (limited to 'src/fsck/fsck.c')
-rw-r--r--src/fsck/fsck.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index cf4d375717..a4a15da1bf 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -316,10 +316,8 @@ int main(int argc, char *argv[]) {
if (arg_force)
cmdline[i++] = "-f";
- if (progress_pipe[1] >= 0) {
- xsprintf(dash_c, "-C%i", progress_pipe[1]);
- cmdline[i++] = dash_c;
- }
+ xsprintf(dash_c, "-C%i", progress_pipe[1]);
+ cmdline[i++] = dash_c;
cmdline[i++] = device;
cmdline[i++] = NULL;
@@ -330,18 +328,15 @@ int main(int argc, char *argv[]) {
goto finish;
} else if (pid == 0) {
/* Child */
- if (progress_pipe[0] >= 0)
- safe_close(progress_pipe[0]);
+ safe_close(progress_pipe[0]);
execv(cmdline[0], (char**) cmdline);
_exit(8); /* Operational error */
}
progress_pipe[1] = safe_close(progress_pipe[1]);
- if (progress_pipe[0] >= 0) {
- progress_rc = process_progress(progress_pipe[0], pid, st.st_rdev);
- progress_pipe[0] = -1;
- }
+ progress_rc = process_progress(progress_pipe[0], pid, st.st_rdev);
+ progress_pipe[0] = -1;
q = wait_for_terminate(pid, &status);
if (q < 0) {