From 0fb28c0973577b283d9d5beb0d8707d5a6026016 Mon Sep 17 00:00:00 2001 From: Guido van Rooij Date: Mon, 7 Apr 1997 18:01:10 +0000 Subject: [PATCH] Fix race Obtained from: Keith Bostic --- lib/libc/stdio/mktemp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index bc4c928e2de9..19125e677ff9 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 @@ -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 */