aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tar.c b/tar.c
index 7d440f451..86f996576 100644
--- a/tar.c
+++ b/tar.c
@@ -300,11 +300,14 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
300 300
301 /* Open the file to be written, if a file is supposed to be written */ 301 /* Open the file to be written, if a file is supposed to be written */
302 if (extractFlag==TRUE && tostdoutFlag==FALSE) { 302 if (extractFlag==TRUE && tostdoutFlag==FALSE) {
303 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, header->mode & ~S_IFMT)) < 0)
304 errorMsg(io_error, header->name, strerror(errno));
305 /* Create the path to the file, just in case it isn't there... 303 /* Create the path to the file, just in case it isn't there...
306 * This should not screw up path permissions or anything. */ 304 * This should not screw up path permissions or anything. */
307 createPath(header->name, 0777); 305 createPath(header->name, 0777);
306 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY,
307 header->mode & ~S_IFMT)) < 0) {
308 errorMsg(io_error, header->name, strerror(errno));
309 return( FALSE);
310 }
308 } 311 }
309 312
310 /* Write out the file, if we are supposed to be doing that */ 313 /* Write out the file, if we are supposed to be doing that */