X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/fbd86d4cc20b02a10edcca92fb7ae0a143e63cc4..1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58:/stdio/FreeBSD/tempnam.c.patch diff --git a/stdio/FreeBSD/tempnam.c.patch b/stdio/FreeBSD/tempnam.c.patch index 5878749..7e1c8be 100644 --- a/stdio/FreeBSD/tempnam.c.patch +++ b/stdio/FreeBSD/tempnam.c.patch @@ -1,6 +1,6 @@ ---- tempnam.c.orig 2008-11-12 17:08:45.000000000 -0800 -+++ tempnam.c 2008-11-12 17:41:23.000000000 -0800 -@@ -57,35 +57,68 @@ tempnam(dir, pfx) +--- tempnam.c.orig 2010-10-25 19:45:24.000000000 -0700 ++++ tempnam.c 2010-10-25 22:01:51.000000000 -0700 +@@ -53,35 +53,60 @@ tempnam(dir, pfx) int sverrno; char *f, *name; @@ -59,14 +59,6 @@ + } +#endif /* __DARWIN_UNIX03 */ f = _PATH_TMP; -+#if __DARWIN_UNIX03 -+ if (access(f, W_OK) < 0) { -+ f = "./"; /* directory inaccessible */ -+ if (access(f, W_OK) < 0) { -+ return(NULL); -+ } -+ } -+#endif /* __DARWIN_UNIX03 */ (void)snprintf(name, MAXPATHLEN, "%s%sXXXXXX", f, pfx); - if ((f = _mktemp(name))) + if ((f = _mktemp(name))) {