summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2013-10-24 19:35:26 +0900
committerAkira TAGOH <akira@tagoh.org>2013-10-24 19:35:26 +0900
commit65872e9e46d17e4461c3a891ef23abe156005e04 (patch)
treef203d4555ca5b6623e84a8fe1cabbc25b82cf736 /test
parent76ea9af816a50c6bb0b3dc2960460a90fadd9cdb (diff)
Fix a build issue on Solaris 10
Use own mkdtemp implementation if not available. Reported by Thomas Klausner and Jörn Clausen
Diffstat (limited to 'test')
-rw-r--r--test/test-migration.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test-migration.c b/test/test-migration.c
index 97096518..f127e276 100644
--- a/test/test-migration.c
+++ b/test/test-migration.c
@@ -11,6 +11,19 @@
#endif
#include <fontconfig/fontconfig.h>
+#ifdef HAVE_MKDTEMP
+#define fc_mkdtemp mkdtemp
+#else
+char *
+fc_mkdtemp (char *template)
+{
+ if (!mktemp (template) || mkdir (template, 0700))
+ return NULL;
+
+ return template;
+}
+#endif
+
FcBool
mkdir_p(const char *dir)
{
@@ -107,7 +120,7 @@ int
main(void)
{
char template[32] = "fontconfig-XXXXXXXX";
- char *tmp = mkdtemp (template);
+ char *tmp = fc_mkdtemp (template);
size_t len = strlen (tmp), xlen, dlen;
char xdg[256], confd[256], fn[256], nfn[256], ud[256], nud[256];
int ret = -1;