From bc4e3bb60458cc52b85ab62dc1356e6c8404ed16 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 21 Mar 2010 23:09:31 +0000 Subject: When all tried file names already existed, mktemp(3) returned without setting errno(2). Behaviour unchanged for mkstemp[s] and mkdtemp. ok guenther deraadt --- lib/libc/stdio/mktemp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc/stdio') diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index abf5fa5b28c..1df399aea51 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mktemp.c,v 1.29 2010/02/11 16:48:36 guenther Exp $ */ +/* $OpenBSD: mktemp.c,v 1.30 2010/03/21 23:09:30 schwarze Exp $ */ /* * Copyright (c) 1996-1998, 2008 Theo de Raadt * Copyright (c) 1997, 2008-2009 Todd C. Miller @@ -82,6 +82,8 @@ mktemp_internal(char *path, int slen, int mode) break; } } while (--tries); + + errno = EEXIST; return(-1); } -- cgit v1.2.3