summaryrefslogtreecommitdiff
path: root/lib/misc.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-11-14 19:15:18 +0000
committerjbj <devnull@localhost>1999-11-14 19:15:18 +0000
commit4e62a322a266e9d95007540d10e67fc75bf80aa7 (patch)
treef1ba2b2704bf0397cc7d0bac2b323480aed56a8a /lib/misc.c
parent471ba3b2386a15b5cd0ad202238dd38161788416 (diff)
downloadlibrpm-tizen-4e62a322a266e9d95007540d10e67fc75bf80aa7.tar.gz
librpm-tizen-4e62a322a266e9d95007540d10e67fc75bf80aa7.tar.bz2
librpm-tizen-4e62a322a266e9d95007540d10e67fc75bf80aa7.zip
lib/rpmio.c: Implement per-fd layers as a stack, add fdPush/fdPop.
lib/rpmio.c: Add fd{Get,Set}{Io,Fp,Fdno} abstraction wrappers. lib/rpmio.c: Start rationalizing debug output by using fdbg to display the fd layer stack. rpm.c: Add --nolibio to disable libio if desired. rpm2cpio.c: Use Fdopen(..., gzdio) and ufdCopy(). build/build.c: Use Fdopen(..., fpio) rather than fdio. build/files.c: Use Fdopen(..., fpio) rather than ufdio. build/parseSpec.c: ditto. lib/macro.c: ditto. lib/rpmrc.c: ditto lib/macro.c: Use Fopen(..., ufdio) in isCompressed() rather that fdOpen(). lib/misc.c: ditto. lib/misc.c: Avoid fstat by using Stat. build/pack.c: Add persist fdLink() and use fdFree() in package{Sources,Binaries} build/pack.c: Try to remove the fdDup before cpioBuildArchive() call. build/pack.c: Use rpmGenPath with %{_builddir}. build/parsePreamble.c: Use fdSize rather than Stat to get icon file size. lib/rpmrc.c: ditto lib/ftp.c: start capturing ufdio layer syserrno/errcookie. CVS patchset: 3424 CVS date: 1999/11/14 19:15:18
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/misc.c b/lib/misc.c
index d315ac20b..6238f3732 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -404,7 +404,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
}
/* XXX FIXME: build/build.c Fdopen assertion failure, makeTempFile uses fdio */
-#ifndef NOTYET
+#ifdef DYING
fd = fdio->open(tfn, (O_CREAT|O_RDWR|O_EXCL), 0700);
#else
fd = Fopen(tfn, "w+x.ufdio");
@@ -424,14 +424,16 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) {
}
#ifndef NOTYET
- fstat(Fileno(fd), &sb2);
+ if (fstat(Fileno(fd), &sb2) == 0)
#else
- Stat(tfn, &sb2);
+ if (Stat(tfn, &sb2) == 0)
#endif
- if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
- rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
- xfree(tfn);
- return 1;
+ {
+ if (sb2.st_ino != sb.st_ino || sb2.st_dev != sb.st_dev) {
+ rpmError(RPMERR_SCRIPT, _("error creating temporary file %s"), tfn);
+ xfree(tfn);
+ return 1;
+ }
}
if (fnptr)