summaryrefslogtreecommitdiff
path: root/build/build.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-11 09:05:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-11 09:05:05 +0300
commitfde961e25b09806e501dd214059ced1b07c1b49c (patch)
treefcfb9e33070c61a9448f6ff9bcb1fa372369763b /build/build.c
parent48ff62a5291458ed1181cd6c31dcadb193ad2f8e (diff)
downloadrpm-fde961e25b09806e501dd214059ced1b07c1b49c.tar.gz
rpm-fde961e25b09806e501dd214059ced1b07c1b49c.tar.bz2
rpm-fde961e25b09806e501dd214059ced1b07c1b49c.zip
Rewrite rpmMkTempFile() for sanity
- Actually use mkstemp() for creating the temp file and return a FD_t dupped from the file descriptor returned by mkstemp(). - Simplify the interface while at it. - Change callers for the new interface. - Yes we now require mkstemp() to work, mkstemp() is in POSIX.1-2001 and this is year 2008...
Diffstat (limited to 'build/build.c')
-rw-r--r--build/build.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/build/build.c b/build/build.c
index d89409d4e..3c6d55283 100644
--- a/build/build.c
+++ b/build/build.c
@@ -126,7 +126,8 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, StringBuf sb,
goto exit;
}
- if (rpmMkTempFile(rootDir, &scriptName, &fd) || fd == NULL || Ferror(fd)) {
+ fd = rpmMkTemp(rootDir, &scriptName);
+ if (fd == NULL || Ferror(fd)) {
rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n"));
rc = RPMRC_FAIL;
goto exit;