summaryrefslogtreecommitdiff
path: root/lib/cpio.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-10-30 16:43:29 +0000
committerjbj <devnull@localhost>1999-10-30 16:43:29 +0000
commit2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0 (patch)
tree5d1b1ea400702929b202811bf728a6e6ecf098ab /lib/cpio.c
parent533991efdbbeff0c0f3b6f5b008c748ee61bc85e (diff)
downloadlibrpm-tizen-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.tar.gz
librpm-tizen-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.tar.bz2
librpm-tizen-2b84d36c2edb0acd8f47bd3316e1535cfdf60fc0.zip
Make fdFileno() static, use Fileno()/Ferror() analogues throughout.
Make ufdClose() static, use Fclose() with ufdio cookie throughout. rpm.c: Clean urlinfoCache and rpmBuildArgs leaks. url.c: urlIsURL() should be here, not in rpmio.c. url.c: Preserve FD_t abstraction by creating ufdGetUrlinfo(). url.c: Create freeUrlinfoCache(). rpmio.c: Create ufdio cookie. CVS patchset: 3407 CVS date: 1999/10/30 16:43:29
Diffstat (limited to 'lib/cpio.c')
-rw-r--r--lib/cpio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/cpio.c b/lib/cpio.c
index fd6ed186b..86258d6cd 100644
--- a/lib/cpio.c
+++ b/lib/cpio.c
@@ -343,7 +343,7 @@ static int expandRegular(FD_t cfd, struct cpioHeader * hdr,
}
ofd = fdOpen(hdr->path, O_CREAT | O_WRONLY, 0);
- if (fdFileno(ofd) < 0)
+ if (Ferror(ofd))
return CPIOERR_OPEN_FAILED;
cbInfo.file = hdr->path;
@@ -747,12 +747,13 @@ static int writeFile(FD_t cfd, struct stat sb, struct cpioFileMapping * map,
size_t nmapped;
#endif
- if (fdFileno(datafd = fdOpen(map->fsPath, O_RDONLY, 0)) < 0)
+ datafd = fdOpen(map->fsPath, O_RDONLY, 0);
+ if (Ferror(datafd))
return CPIOERR_OPEN_FAILED;
#if HAVE_MMAP
nmapped = 0;
- mapped = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fdFileno(datafd), 0);
+ mapped = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, Fileno(datafd), 0);
if (mapped != (void *)-1) {
b = (char *)mapped;
nmapped = sb.st_size;