From f06986926ae2ed76023956e6594711f9e65b4106 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 21 Feb 2017 19:44:53 -0500 Subject: libuv: Implement mkdtemp on Solaris 10 --- Utilities/cmlibuv/src/unix/fs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c index f9513ea..8a4ba7a 100644 --- a/Utilities/cmlibuv/src/unix/fs.c +++ b/Utilities/cmlibuv/src/unix/fs.c @@ -244,9 +244,19 @@ skip: #endif } +#if defined(__sun) && _XOPEN_SOURCE < 600 +static char* uv__mkdtemp(char *template) +{ + if (!mktemp(template) || mkdir(template, 0700)) + return NULL; + return template; +} +#else +#define uv__mkdtemp mkdtemp +#endif static ssize_t uv__fs_mkdtemp(uv_fs_t* req) { - return mkdtemp((char*) req->path) ? 0 : -1; + return uv__mkdtemp((char*) req->path) ? 0 : -1; } -- cgit v0.12