summaryrefslogtreecommitdiff
path: root/tests/rm/fail-eperm
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-03 13:57:26 +0000
committerJim Meyering <jim@meyering.net>2006-10-03 13:57:26 +0000
commit184dcf2cafbfaa93cdb2daf65c05025347d69a84 (patch)
tree7989fbea3e61c4931c710476a8059fedaec98292 /tests/rm/fail-eperm
parent41011fa81d54ccde9523a5a7e908763889f385bb (diff)
downloadcoreutils-184dcf2cafbfaa93cdb2daf65c05025347d69a84.tar.xz
* tests/rm/fail-eperm: Report failure also if rm is terminated by
a signal.
Diffstat (limited to 'tests/rm/fail-eperm')
-rwxr-xr-xtests/rm/fail-eperm18
1 files changed, 14 insertions, 4 deletions
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 = <RM>;
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