diff options
author | ewt <devnull@localhost> | 1997-07-31 16:02:19 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1997-07-31 16:02:19 +0000 |
commit | fb72e505a9a7bcc8cf54cc8bc4306a951da5dee6 (patch) | |
tree | 56c4d15b14dd68ebad86c72eff05b885be3e43c2 /lib/cpio.c | |
parent | 9174be23bae7e21c3e1ffb11c0b301a2ca14bc1b (diff) | |
download | librpm-tizen-fb72e505a9a7bcc8cf54cc8bc4306a951da5dee6.tar.gz librpm-tizen-fb72e505a9a7bcc8cf54cc8bc4306a951da5dee6.tar.bz2 librpm-tizen-fb72e505a9a7bcc8cf54cc8bc4306a951da5dee6.zip |
1) improved cpio error message
2) moved bad chdir() restoration
3) close files after writing their contents to cpio archive
CVS patchset: 1779
CVS date: 1997/07/31 16:02:19
Diffstat (limited to 'lib/cpio.c')
-rw-r--r-- | lib/cpio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/cpio.c b/lib/cpio.c index 44ccb0526..9825454c4 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -716,6 +716,8 @@ static int writeFile(int fd, struct stat sb, struct cpioFileMapping * map, sb.st_size -= amount; } + + close(datafd); } else if (writeData && S_ISLNK(sb.st_mode)) { if ((rc = safewrite(fd, symbuf, amount))) return rc; @@ -796,8 +798,10 @@ int cpioBuildArchive(int fd, struct cpioFileMapping * mappings, else rc = lstat(mappings[i].fsPath, &sb); - if (rc) + if (rc) { + if (failedFile) *failedFile = mappings[i].fsPath; return CPIO_STAT_FAILED; + } if (!S_ISDIR(sb.st_mode) && sb.st_nlink > 1) { hlink = hlinkList.next; |