summaryrefslogtreecommitdiff
path: root/usr/src/cmd/tar/tar.c
diff options
context:
space:
mode:
authorRich Burridge <rich.burridge@oracle.com>2010-05-24 10:51:20 -0700
committerRich Burridge <rich.burridge@oracle.com>2010-05-24 10:51:20 -0700
commit31732068cc7054b813fce47c5beddb148302adca (patch)
tree3229466319d37dbda3d2d03fa50ad0d65385f0fe /usr/src/cmd/tar/tar.c
parent8a5de3ffa1408e996e1887c2131fefa579ec9571 (diff)
downloadillumos-joyent-31732068cc7054b813fce47c5beddb148302adca.tar.gz
6375866 tar c usually exits with good status if interrupted
Diffstat (limited to 'usr/src/cmd/tar/tar.c')
-rw-r--r--usr/src/cmd/tar/tar.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/cmd/tar/tar.c b/usr/src/cmd/tar/tar.c
index 9ef5de909c..3b81202e82 100644
--- a/usr/src/cmd/tar/tar.c
+++ b/usr/src/cmd/tar/tar.c
@@ -5007,6 +5007,14 @@ closevol(void)
static void
done(int n)
{
+ /*
+ * If we were terminated in some way, and we would otherwise have
+ * exited with a value of 0, adjust to 1, so that external callers
+ * can determine this by looking at the exit status.
+ */
+ if (term && n == 0)
+ n = 1;
+
if (tfile != NULL)
(void) unlink(tname);
if (compress_opt != NULL)