summaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c
index 826ab96..01997e4 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -156,6 +156,7 @@ extern int tar_main(int argc, char **argv)
int tostdoutFlag = FALSE;
int firstOpt = TRUE;
int stopIt;
+ int status;
if (argc <= 1)
@@ -227,16 +228,21 @@ extern int tar_main(int argc, char **argv)
#ifndef BB_FEATURE_TAR_CREATE
fatalError( "This version of tar was not compiled with tar creation support.\n");
#else
- exit(writeTarFile(tarName, verboseFlag, argv, excludeList));
+ status = writeTarFile(tarName, verboseFlag, argv, excludeList);
#endif
}
if (listFlag == TRUE || extractFlag == TRUE) {
if (*argv)
extractList = argv;
- exit(readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
- verboseFlag, extractList, excludeList));
+ status = readTarFile(tarName, extractFlag, listFlag, tostdoutFlag,
+ verboseFlag, extractList, excludeList);
}
+ if (status == TRUE)
+ return EXIT_SUCCESS;
+ else
+ return EXIT_FAILURE;
+
flagError:
fatalError( "Exactly one of 'c', 'x' or 't' must be specified\n");
}