aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tar.c b/tar.c
index 1fdbf8c1c..bbd86628a 100644
--- a/tar.c
+++ b/tar.c
@@ -38,6 +38,7 @@
38#include <signal.h> 38#include <signal.h>
39#include <time.h> 39#include <time.h>
40#include <sys/types.h> 40#include <sys/types.h>
41#include <sys/sysmacros.h>
41 42
42 43
43static const char tar_usage[] = 44static const char tar_usage[] =
@@ -276,7 +277,7 @@ static void readTarFile (int fileCount, char **fileTable)
276 * Open the tar file for reading. 277 * Open the tar file for reading.
277 */ 278 */
278 if ((tarName == NULL) || !strcmp (tarName, "-")) { 279 if ((tarName == NULL) || !strcmp (tarName, "-")) {
279 tarFd = STDIN; 280 tarFd = fileno(stdin);
280 } else 281 } else
281 tarFd = open (tarName, O_RDONLY); 282 tarFd = open (tarName, O_RDONLY);
282 283
@@ -552,7 +553,7 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
552 * Start the output file. 553 * Start the output file.
553 */ 554 */
554 if (tostdoutFlag == TRUE) 555 if (tostdoutFlag == TRUE)
555 outFd = STDOUT; 556 outFd = fileno(stdout);
556 else { 557 else {
557 if ( S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) ) { 558 if ( S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) ) {
558 devFileFlag = TRUE; 559 devFileFlag = TRUE;
@@ -650,7 +651,7 @@ static void writeTarFile (int fileCount, char **fileTable)
650 */ 651 */
651 if ((tarName == NULL) || !strcmp (tarName, "-")) { 652 if ((tarName == NULL) || !strcmp (tarName, "-")) {
652 tostdoutFlag = TRUE; 653 tostdoutFlag = TRUE;
653 tarFd = STDOUT; 654 tarFd = fileno(stdout);
654 } else 655 } else
655 tarFd = open (tarName, O_WRONLY | O_CREAT | O_TRUNC, 0666); 656 tarFd = open (tarName, O_WRONLY | O_CREAT | O_TRUNC, 0666);
656 657