2002-09-29 20:29:02 -04:00
|
|
|
$OpenBSD: patch-sbr_m_tmpfil_c,v 1.1 2002/09/30 00:29:02 pvalchev Exp $
|
|
|
|
--- sbr/m_tmpfil.c.orig Thu Sep 9 23:22:41 1999
|
|
|
|
+++ sbr/m_tmpfil.c Mon Sep 30 18:22:06 2002
|
|
|
|
@@ -14,15 +14,18 @@ m_tmpfil (char *template)
|
1998-04-30 00:24:30 -04:00
|
|
|
static char tmpfil[BUFSIZ];
|
|
|
|
|
1999-03-26 03:48:27 -05:00
|
|
|
snprintf (tmpfil, sizeof(tmpfil), "/tmp/%sXXXXXX", template);
|
2000-03-08 00:11:35 -05:00
|
|
|
-/*
|
|
|
|
- Mkstemp work postponed until later -Doug
|
|
|
|
#ifdef HAVE_MKSTEMP
|
|
|
|
- unlink(mkstemp(tmpfil));
|
|
|
|
+ {
|
|
|
|
+ int fd;
|
|
|
|
+
|
|
|
|
+ fd = mkstemp (tmpfil);
|
|
|
|
+ if (fd == -1)
|
|
|
|
+ return 0;
|
|
|
|
+ close (fd);
|
|
|
|
+ unlink (tmpfil);
|
|
|
|
+ }
|
|
|
|
#else
|
|
|
|
-*/
|
|
|
|
unlink(mktemp(tmpfil));
|
|
|
|
-/*
|
|
|
|
#endif
|
|
|
|
-*/
|
1998-04-30 00:24:30 -04:00
|
|
|
return tmpfil;
|
|
|
|
}
|