Commit Diff
Diff:
6c56e645e3850530357a92aca2aca81ac637e453
c4a0d7aa9766ffb6da9c3c3bd495af9ce61ef5a9
Commit:
c4a0d7aa9766ffb6da9c3c3bd495af9ce61ef5a9
Tree:
47c6f13a7db5ec0c12d39ebb41c2fe52cfb2de13
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Tue Nov 19 07:24:53 2019 UTC
Message:
replace mktemp with mkstemp to silence warnings on Linux
blob - ec53ac5d9820c89999d61370ab947b03eee84f21
blob + c798d46e3764cea22f0e65d69f7e5191bd7989fe
--- raxfr.c
+++ raxfr.c
@@ -26,7 +26,7 @@
*
*/
/*
- * $Id: raxfr.c,v 1.35 2019/11/19 07:13:04 pjp Exp $
+ * $Id: raxfr.c,v 1.36 2019/11/19 07:24:53 pjp Exp $
*/
#include <sys/types.h>
@@ -2167,13 +2167,14 @@ pull_rzone(struct rzone *rzone, time_t now, int dosche
}
snprintf(buf, sizeof(buf), "%s.XXXXXXXXXXXXXX", p);
- if ((p = mktemp(buf)) == NULL) {
+ if ((mkstemp(buf)) == -1) {
dolog(LOG_INFO, "can't determine temporary filename from %s (3)\n", rzone->filename);
if (doschedule)
schedule_retry(rzone->zonename, now + rzone->soa.retry);
return -1;
}
+ p = &buf[0];
umask(022);
f = fopen(p, "w");
repomaster@centroid.eu