diff options
-rw-r--r-- | e2fsprogs/fsck.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c index 1c285bb92..f5aa3dbe4 100644 --- a/e2fsprogs/fsck.c +++ b/e2fsprogs/fsck.c | |||
@@ -414,7 +414,7 @@ static void kill_all_if_got_signal(void) | |||
414 | static int wait_one(int flags) | 414 | static int wait_one(int flags) |
415 | { | 415 | { |
416 | int status; | 416 | int status; |
417 | int sig; | 417 | int exitcode; |
418 | struct fsck_instance *inst, *prev; | 418 | struct fsck_instance *inst, *prev; |
419 | pid_t pid; | 419 | pid_t pid; |
420 | 420 | ||
@@ -448,15 +448,16 @@ static int wait_one(int flags) | |||
448 | } | 448 | } |
449 | child_died: | 449 | child_died: |
450 | 450 | ||
451 | status = WEXITSTATUS(status); | 451 | exitcode = WEXITSTATUS(status); |
452 | if (WIFSIGNALED(status)) { | 452 | if (WIFSIGNALED(status)) { |
453 | unsigned sig; | ||
453 | sig = WTERMSIG(status); | 454 | sig = WTERMSIG(status); |
454 | status = EXIT_UNCORRECTED; | 455 | exitcode = EXIT_UNCORRECTED; |
455 | if (sig != SIGINT) { | 456 | if (sig != SIGINT) { |
456 | printf("Warning: %s %s terminated " | 457 | printf("Warning: %s %s terminated " |
457 | "by signal %d\n", | 458 | "by signal %u\n", |
458 | inst->prog, inst->device, sig); | 459 | inst->prog, inst->device, sig); |
459 | status = EXIT_ERROR; | 460 | exitcode = EXIT_ERROR; |
460 | } | 461 | } |
461 | } | 462 | } |
462 | 463 | ||
@@ -492,12 +493,12 @@ static int wait_one(int flags) | |||
492 | else | 493 | else |
493 | G.instance_list = inst->next; | 494 | G.instance_list = inst->next; |
494 | if (G.verbose > 1) | 495 | if (G.verbose > 1) |
495 | printf("Finished with %s (exit status %d)\n", | 496 | printf("Finished with %s (exit status %u)\n", |
496 | inst->device, status); | 497 | inst->device, exitcode); |
497 | G.num_running--; | 498 | G.num_running--; |
498 | free_instance(inst); | 499 | free_instance(inst); |
499 | 500 | ||
500 | return status; | 501 | return exitcode; |
501 | } | 502 | } |
502 | 503 | ||
503 | /* | 504 | /* |