From 72cade6db5fd3f6f001295a5f4edeecf44e36045 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Fri, 23 Sep 2011 19:05:35 +0530 Subject: build: Solaris build fixes Change-Id: I977903f26dbb2c8d1632b3a1c52bd8af4ce8652f BUG: 3446 Reviewed-on: http://review.gluster.com/502 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- libglusterfs/src/compat.c | 21 +++++++++++++++++++++ libglusterfs/src/compat.h | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c index 90b86d20de5..a5a49d4e6a1 100644 --- a/libglusterfs/src/compat.c +++ b/libglusterfs/src/compat.c @@ -528,6 +528,27 @@ solaris_rename (const char *old_path, const char *new_path) return rename(old_path, new_path); } + + +char * +mkdtemp (char *tempstring) +{ + char *new_string = NULL; + int ret = 0; + + new_string = mktemp (tempstring); + if (!new_string) + goto out; + + ret = mkdir (new_string, 0700); + if (ret < 0) + new_string = NULL; + +out: + return new_string; +} + + #endif /* GF_SOLARIS_HOST_OS */ #ifndef HAVE_STRNLEN diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index b37307f40ac..b04a71df4f0 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -287,7 +287,7 @@ int solaris_unlink (const char *pathname); #define GF_SOLARIS_XATTR_DIR ".glusterfs_xattr_inode" int solaris_xattr_resolve_path (const char *real_path, char **path); - +char *mkdtemp (char *__template); #endif /* GF_SOLARIS_HOST_OS */ #ifndef HAVE_ARGP -- cgit