Fix error message when archive fails to open.
[pintos-anon] / src / tests / tests.pm
index 5e34e866a8a30a5fff9dad2bb2e3b3ba0e05d873..179f110a9f986d75481f18ab950545f0e18c242e 100644 (file)
@@ -154,7 +154,7 @@ sub compare_output {
     my $ignore_exit_codes = exists $options{IGNORE_EXIT_CODES};
     if ($ignore_exit_codes) {
        delete $options{IGNORE_EXIT_CODES};
-       @output = grep (!/^[a-zA-Z0-9-_]+: exit\(\d+\)$/, @output);
+       @output = grep (!/^[a-zA-Z0-9-_]+: exit\(\-?\d+\)$/, @output);
     }
     my $ignore_user_faults = exists $options{IGNORE_USER_FAULTS};
     if ($ignore_user_faults) {
@@ -510,7 +510,7 @@ sub flatten_hierarchy {
 sub read_tar {
     my ($archive) = @_;
     my (%content);
-    open (ARCHIVE, '<', $archive) or fail "$archive: open: $1\n";
+    open (ARCHIVE, '<', $archive) or fail "$archive: open: $!\n";
     for (;;) {
        my ($header);
        if ((my $retval = sysread (ARCHIVE, $header, 512)) != 512) {