From: Jim Meyering Date: Tue, 3 Oct 2006 13:57:26 +0000 (+0000) Subject: * tests/rm/fail-eperm: Report failure also if rm is terminated by X-Git-Tag: COREUTILS-6_4~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=184dcf2cafbfaa93cdb2daf65c05025347d69a84;p=platform%2Fupstream%2Fcoreutils.git * tests/rm/fail-eperm: Report failure also if rm is terminated by a signal. --- diff --git a/ChangeLog b/ChangeLog index d970da9e0..bbb010e69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-10-03 Jim Meyering + * tests/rm/fail-eperm: Report failure also if rm is terminated by + a signal. + * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c and one in shred.c -- that were added before coreutils-6.3. Reported by Michael Deutschmann. diff --git a/tests/rm/fail-eperm b/tests/rm/fail-eperm index 7e146d4bf..fe1e73d73 100755 --- a/tests/rm/fail-eperm +++ b/tests/rm/fail-eperm @@ -103,10 +103,20 @@ foreach my $dir (@dir_list) my $line = ; close RM; - my $status = $? >> 8; - $status == 1 - or die "$ME: unexpected exit status from `$cmd';\n" - . " got $status, expected 1\n"; + my $rc = $?; + if (0x80 < $rc) + { + my $status = $rc >> 8; + $status == 1 + or die "$ME: unexpected exit status from `$cmd';\n" + . " got $status, expected 1\n"; + } + else + { + # Terminated by a signal. + my $sig_num = $rc & 0x7F; + die "$ME: command `$cmd' died with signal $sig_num\n"; + } my $exp = "$rm: cannot remove `$target_file':"; $line