summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/diff/sdiff.c
diff options
context:
space:
mode:
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"