aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/tar.c b/tar.c
index adae6c94c..21ef24dcb 100644
--- a/tar.c
+++ b/tar.c
@@ -542,8 +542,10 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
542 printf ("x %s\n", outName); 542 printf ("x %s\n", outName);
543 543
544 if (hardLink) { 544 if (hardLink) {
545 if (link (hp->linkName, outName) < 0) 545 if (link (hp->linkName, outName) < 0) {
546 perror (outName); 546 perror (outName);
547 return;
548 }
547 /* Set the file time */ 549 /* Set the file time */
548 utb.actime = mtime; 550 utb.actime = mtime;
549 utb.modtime = mtime; 551 utb.modtime = mtime;
@@ -556,8 +558,10 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
556 558
557 if (softLink) { 559 if (softLink) {
558#ifdef S_ISLNK 560#ifdef S_ISLNK
559 if (symlink (hp->linkName, outName) < 0) 561 if (symlink (hp->linkName, outName) < 0) {
560 perror (outName); 562 perror (outName);
563 return;
564 }
561 /* Try to change ownership of the symlink. 565 /* Try to change ownership of the symlink.
562 * If libs doesn't support that, don't bother. 566 * If libs doesn't support that, don't bother.
563 * Changing the pointed-to file is the Wrong Thing(tm). 567 * Changing the pointed-to file is the Wrong Thing(tm).
@@ -582,15 +586,16 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
582 * If the file is a directory, then just create the path. 586 * If the file is a directory, then just create the path.
583 */ 587 */
584 if (S_ISDIR (mode)) { 588 if (S_ISDIR (mode)) {
585 createPath (outName, mode); 589 if (createPath (outName, mode)==TRUE) {
586 /* Set the file time */ 590 /* Set the file time */
587 utb.actime = mtime; 591 utb.actime = mtime;
588 utb.modtime = mtime; 592 utb.modtime = mtime;
589 utime (outName, &utb); 593 utime (outName, &utb);
590 /* Set the file permissions */ 594 /* Set the file permissions */
591 chown(outName, uid, gid); 595 chown(outName, uid, gid);
592 chmod(outName, mode); 596 chmod(outName, mode);
593 return; 597 return;
598 }
594 } 599 }
595 600
596 /* 601 /*