summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/diff/sdiff.c
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1998-03-04 01:36:04 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1998-03-04 01:36:04 +0000
commitb016a3e51ff957476d21fb0e121ca14cd1cdf708 (patch)
treeb835dd6a4786aa6b77bff5fa318e4cd1b43b4555 /gnu/usr.bin/diff/sdiff.c
parent626b3c76feebbc0613871d29e13dd4122f3ba747 (diff)
tmpnam() -> mkstemp()
Diffstat (limited to 'gnu/usr.bin/diff/sdiff.c')
-rw-r--r--gnu/usr.bin/diff/sdiff.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/usr.bin/diff/sdiff.c b/gnu/usr.bin/diff/sdiff.c
index b64f1d03836..ce278c61c56 100644
--- a/gnu/usr.bin/diff/sdiff.c
+++ b/gnu/usr.bin/diff/sdiff.c
@@ -84,7 +84,18 @@ static void usage PARAMS((void));
/* this lossage until the gnu libc conquers the universe */
#if HAVE_TMPNAM
-#define private_tempnam() tmpnam ((char *) 0)
+char *private_tempnam()
+{
+ char *p;
+ int fd;
+
+ p = strdup("/tmp/sdiff.XXXXXXXXXX");
+ fd = mkstemp(p);
+ if (fd < 0)
+ return NULL;
+ close(fd);
+ return p;
+}
#else
#ifndef PVT_tmpdir
#define PVT_tmpdir "/tmp"