summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-06-16 04:36:46 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 22:01:54 -0700
commit442f64a83bd2c5da085bc6dc50533df2d483be3b (patch)
treef02c5fa0725bde3f79a83a52afc0646582dd33cf /libglusterfs/src
parent41263d553f25e4f59d2751e7e3b2a23b264370f8 (diff)
build: fixes to work on solaris
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3002 (build issues on solaris) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3002
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/compat.c19
-rw-r--r--libglusterfs/src/compat.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/libglusterfs/src/compat.c b/libglusterfs/src/compat.c
index 42c20f52756..72bd0d3e2b5 100644
--- a/libglusterfs/src/compat.c
+++ b/libglusterfs/src/compat.c
@@ -528,6 +528,25 @@ 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 4d336ea0647..34e72a8a1f2 100644
--- a/libglusterfs/src/compat.h
+++ b/libglusterfs/src/compat.h
@@ -284,6 +284,8 @@ int solaris_rename (const char *oldpath, const char *newpath);
int solaris_unlink (const char *pathname);
+char *mkdtemp (char *temp);
+
#define GF_SOLARIS_XATTR_DIR ".glusterfs_xattr_inode"
int solaris_xattr_resolve_path (const char *real_path, char **path);