Created
October 11, 2010 06:25
-
-
Save jonyesno/620099 to your computer and use it in GitHub Desktop.
Make tarsnap return same exit codes as bsdtar. Helps with detecting transient v fatal errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- tarsnap-autoconf-1.0.32.orig/tar/write.c 2012-02-22 13:10:53.000000000 +0100 | |
+++ tarsnap-autoconf-1.0.32/tar/write.c 2012-06-28 02:10:21.000000000 +0200 | |
@@ -683,7 +683,7 @@ | |
if (!tree) { | |
bsdtar_warnc(bsdtar, errno, "%s: Cannot open", path); | |
- bsdtar->return_value = 1; | |
+ bsdtar->return_value = 2; | |
return; | |
} | |
@@ -709,7 +709,7 @@ | |
if (tree_ret == TREE_ERROR_DIR) { | |
bsdtar_warnc(bsdtar, errno, | |
"%s: Couldn't visit directory", name); | |
- bsdtar->return_value = 1; | |
+ bsdtar->return_value = 3; | |
} | |
if (tree_ret != TREE_REGULAR) | |
continue; | |
@@ -729,7 +729,7 @@ | |
/* Couldn't lstat(); must not exist. */ | |
bsdtar_warnc(bsdtar, errno, "%s: Cannot stat", name); | |
/* Return error if files disappear during traverse. */ | |
- bsdtar->return_value = 1; | |
+ bsdtar->return_value = 4; | |
continue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment