diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-21 19:41:37 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-06-21 19:41:37 +0000 |
commit | 5f0f7d3428d4c8cc51fef8fcb4e7bf0ac616dab2 (patch) | |
tree | 3cdbaddffecc92649215fdc71a43b4e8e86b7ea3 /tar.c | |
parent | ce5c25da381038fa6d2640a2f4aa77771ca2ee43 (diff) | |
download | busybox-w32-5f0f7d3428d4c8cc51fef8fcb4e7bf0ac616dab2.tar.gz busybox-w32-5f0f7d3428d4c8cc51fef8fcb4e7bf0ac616dab2.tar.bz2 busybox-w32-5f0f7d3428d4c8cc51fef8fcb4e7bf0ac616dab2.zip |
Rewrote mkdir (and touched lots of things in the process).
git-svn-id: svn://busybox.net/trunk/busybox@2873 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tar.c')
-rw-r--r-- | tar.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -338,7 +338,9 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
338 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { | 338 | if (extractFlag==TRUE && tostdoutFlag==FALSE) { |
339 | /* Create the path to the file, just in case it isn't there... | 339 | /* Create the path to the file, just in case it isn't there... |
340 | * This should not screw up path permissions or anything. */ | 340 | * This should not screw up path permissions or anything. */ |
341 | create_path(header->name, 0777); | 341 | char *dir = dirname (header->name); |
342 | make_directory (dir, -1, FILEUTILS_RECUR); | ||
343 | free (dir); | ||
342 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, | 344 | if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, |
343 | header->mode & ~S_IFMT)) < 0) { | 345 | header->mode & ~S_IFMT)) < 0) { |
344 | error_msg(io_error, header->name, strerror(errno)); | 346 | error_msg(io_error, header->name, strerror(errno)); |
@@ -397,8 +399,7 @@ tarExtractDirectory(TarInfo *header, int extractFlag, int tostdoutFlag) | |||
397 | if (extractFlag==FALSE || tostdoutFlag==TRUE) | 399 | if (extractFlag==FALSE || tostdoutFlag==TRUE) |
398 | return( TRUE); | 400 | return( TRUE); |
399 | 401 | ||
400 | if (create_path(header->name, header->mode) != TRUE) { | 402 | if (make_directory(header->name, header->mode, FILEUTILS_RECUR) < 0) { |
401 | perror_msg("%s: Cannot mkdir", header->name); | ||
402 | return( FALSE); | 403 | return( FALSE); |
403 | } | 404 | } |
404 | /* make the final component, just in case it was | 405 | /* make the final component, just in case it was |