summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/mktemp.c
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>1997-04-07 18:01:10 +0000
committerguido <guido@FreeBSD.org>1997-04-07 18:01:10 +0000
commit5b77d8f791df05a5162504555a1585bfe9afa200 (patch)
treef66553daf6adeaa470da5029e2294a06d0d81aa3 /lib/libc/stdio/mktemp.c
parent506312bdd08f73c2b066b2aa82387aa0810222bc (diff)
downloadFreeBSD-src-5b77d8f791df05a5162504555a1585bfe9afa200.zip
FreeBSD-src-5b77d8f791df05a5162504555a1585bfe9afa200.tar.gz
Fix race
Obtained from: Keith Bostic
Diffstat (limited to 'lib/libc/stdio/mktemp.c')
-rw-r--r--lib/libc/stdio/mktemp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index bc4c928..19125e6 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id$";
+ "$Id: mktemp.c,v 1.6 1997/02/22 15:02:16 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -109,7 +109,7 @@ _gettemp(path, doopen)
if (errno != EEXIST)
return(0);
}
- else if (stat(path, &sbuf))
+ else if (lstat(path, &sbuf))
return(errno == ENOENT ? 1 : 0);
/* tricky little algorithm for backward compatibility */
OpenPOWER on IntegriCloud