- millert@cvs.openbsd.org 2008/08/21 16:54:44
[mktemp.c] Remove useless code, the kernel will set errno appropriately if an element in the path does not exist. OK deraadt@ pvalchev@
This commit is contained in:
parent
dc0e09b41c
commit
3a359b3228
|
@ -17,6 +17,10 @@
|
|||
- deraadt@cvs.openbsd.org 2008/07/22 21:47:45
|
||||
[mktemp.c]
|
||||
use arc4random_uniform(); ok djm millert
|
||||
- millert@cvs.openbsd.org 2008/08/21 16:54:44
|
||||
[mktemp.c]
|
||||
Remove useless code, the kernel will set errno appropriately if an
|
||||
element in the path does not exist. OK deraadt@ pvalchev@
|
||||
|
||||
20110922
|
||||
- OpenBSD CVS Sync
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */
|
||||
/* Changes: Removed mktemp */
|
||||
|
||||
/* $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.
|
||||
|
@ -112,26 +112,6 @@ _gettemp(path, doopen, domkdir, 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 =
|
||||
|
|
Loading…
Reference in New Issue