summaryrefslogtreecommitdiff
path: root/archival/gzip.c
diff options
context:
space:
mode:
authorMatt Kraai2002-03-22 22:55:51 +0000
committerMatt Kraai2002-03-22 22:55:51 +0000
commitef8b112d77c3a05f17fa108d93d44d9a66902853 (patch)
tree40b1e6069033f779a6d252b467c994d61f85e2f4 /archival/gzip.c
parentb88868276ce98f0842635835c69936632da83858 (diff)
downloadbusybox-ef8b112d77c3a05f17fa108d93d44d9a66902853.zip
busybox-ef8b112d77c3a05f17fa108d93d44d9a66902853.tar.gz
* archival/gzip.c (gzip_main): Ensure that the output is a terminal and use
error_msg to display the error message.
Diffstat (limited to 'archival/gzip.c')
-rw-r--r--archival/gzip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index fed9390..44b5fe3 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1312,8 +1312,8 @@ int gzip_main(int argc, char **argv)
outFileNum = STDOUT_FILENO;
}
- if (path == NULL && force == 0) {
- perror_msg("compressed data not written to a terminal. Use -f to force compression.");
+ if (path == NULL && isatty(outFileNum) && force == 0) {
+ error_msg("compressed data not written to a terminal. Use -f to force compression.");
free(path);
continue;
}