mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 00:02:44 +00:00
Fix race
Obtained from: Keith Bostic
This commit is contained in:
parent
6a5c059562
commit
0fb28c0973
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24707
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user