summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/tar.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/archival/tar.c b/archival/tar.c
index bff2482..7167d95 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -577,17 +577,15 @@ readHeader (const TarHeader * hp, int fileCount, char **fileTable)
} else {
outFd = open (name, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
+ if (outFd < 0) {
+ perror (name);
+ skipFileFlag = TRUE;
+ return;
+ }
+ chown(name, uid, gid);
+ chmod(name, mode);
}
- if (outFd < 0) {
- perror (name);
- skipFileFlag = TRUE;
- return;
- }
- if (tostdoutFlag == FALSE) {
- fchown(outFd, uid, gid);
- fchmod(outFd, mode);
- }
/*
* If the file is empty, then that's all we need to do.