diff options
author | Matt Kraai <kraai@debian.org> | 2001-06-21 19:41:37 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2001-06-21 19:41:37 +0000 |
commit | ceeff7381929930fe8d7e33543e285d5fdcf1c68 (patch) | |
tree | 3cdbaddffecc92649215fdc71a43b4e8e86b7ea3 /archival/tar.c | |
parent | 091781e20eb055ac286b5a617d53a50c7d6c451e (diff) | |
download | busybox-w32-ceeff7381929930fe8d7e33543e285d5fdcf1c68.tar.gz busybox-w32-ceeff7381929930fe8d7e33543e285d5fdcf1c68.tar.bz2 busybox-w32-ceeff7381929930fe8d7e33543e285d5fdcf1c68.zip |
Rewrote mkdir (and touched lots of things in the process).
Diffstat (limited to 'archival/tar.c')
-rw-r--r-- | archival/tar.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c index 55fb12c2c..e68194ff7 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -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 |