From 2f77cd98bf480826595e4493236ffb14673697fb Mon Sep 17 00:00:00 2001 From: millert Date: Thu, 21 Aug 2008 16:54:44 +0000 Subject: [PATCH] Remove useless code, the kernel will set errno appropriately if an element in the path does not exist. OK deraadt@ pvalchev@ --- lib/libc/stdio/mktemp.c | 22 +--------------------- 1 file changed, 1 insertion(+), 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 = -- 2.20.1