summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2010-03-21 23:09:31 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2010-03-21 23:09:31 +0000
commitbc4e3bb60458cc52b85ab62dc1356e6c8404ed16 (patch)
tree14a620d167cdacd1b4f5cb70ad096d200e544345
parent36b1484094bb6a973d5a6a18071f1ca178c97ea1 (diff)
When all tried file names already existed, mktemp(3) returned without
setting errno(2). Behaviour unchanged for mkstemp[s] and mkdtemp. ok guenther deraadt
-rw-r--r--lib/libc/stdio/mktemp.c4
1 files changed, 3 insertions, 1 deletions
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);
}