diff options
author | Brad King <brad.king@kitware.com> | 2017-02-22 00:44:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-26 15:48:26 (GMT) |
commit | f06986926ae2ed76023956e6594711f9e65b4106 (patch) | |
tree | ae493aab26215cddd38357350b52f0e195ebb170 /Utilities/cmlibuv/src/unix | |
parent | 5651257fffc4482861c2ed6a67721fd00f0da6c0 (diff) | |
download | CMake-f06986926ae2ed76023956e6594711f9e65b4106.zip CMake-f06986926ae2ed76023956e6594711f9e65b4106.tar.gz CMake-f06986926ae2ed76023956e6594711f9e65b4106.tar.bz2 |
libuv: Implement mkdtemp on Solaris 10
Diffstat (limited to 'Utilities/cmlibuv/src/unix')
-rw-r--r-- | Utilities/cmlibuv/src/unix/fs.c | 12 |
1 files changed, 11 insertions, 1 deletions
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; } |