summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/mktemp.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2008-08-21 16:54:44 +0000
committermillert <millert@openbsd.org>2008-08-21 16:54:44 +0000
commit2f77cd98bf480826595e4493236ffb14673697fb (patch)
tree0a4597af7fc58a483035c7a5fe21bb053651c7bb /lib/libc/stdio/mktemp.c
parentAdd missing dependency for external.h, from Don Hiatt. (diff)
downloadwireguard-openbsd-2f77cd98bf480826595e4493236ffb14673697fb.tar.xz
wireguard-openbsd-2f77cd98bf480826595e4493236ffb14673697fb.zip
Remove useless code, the kernel will set errno appropriately if an
element in the path does not exist. OK deraadt@ pvalchev@
Diffstat (limited to 'lib/libc/stdio/mktemp.c')
-rw-r--r--lib/libc/stdio/mktemp.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index a613daea5bf..e5a584ca6a0 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */
+/* $OpenBSD: mktemp.c,v 1.22 2008/08/21 16:54:44 millert Exp $ */
/*
* Copyright (c) 1987, 1993
* The Regents of the University of California. All rights reserved.
@@ -118,26 +118,6 @@ _gettemp(char *path, int *doopen, int domkdir, int slen)
}
start = trv + 1;
- /* Check the target directory. */
- if (doopen || domkdir) {
- for (;; --trv) {
- if (trv <= path)
- break;
- if (*trv == '/') {
- *trv = '\0';
- rval = stat(path, &sbuf);
- *trv = '/';
- if (rval != 0)
- return(0);
- if (!S_ISDIR(sbuf.st_mode)) {
- errno = ENOTDIR;
- return(0);
- }
- break;
- }
- }
- }
-
for (;;) {
if (doopen) {
if ((*doopen =