diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2008-08-21 16:54:45 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2008-08-21 16:54:45 +0000 |
commit | 53072d2b8562cdafcae237c42a5764f4bb7ab4aa (patch) | |
tree | 052a2451de87adb3c49caa9fb45151ad412cfe76 /lib/libc/stdio/mktemp.c | |
parent | 57e30536959d5985152a29746d40c1a601c91ece (diff) |
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.c | 22 |
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 = |