summaryrefslogtreecommitdiff
path: root/test-mkdtemp.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2016-01-15 23:08:59 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2016-01-15 23:08:59 +0000
commitca0834218adf25b9cf44601400c1c4a8600d9f5f (patch)
treed03ac3be5c40f1897b2b6802fb3b1a2b0c4e7cfe /test-mkdtemp.c
parent0ae9da150d599305f27b737214acfa3dc181d0e8 (diff)
Diffstat (limited to 'test-mkdtemp.c')
-rw-r--r--test-mkdtemp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test-mkdtemp.c b/test-mkdtemp.c
new file mode 100644
index 0000000000000..a0cb30e22f4a1
--- /dev/null
+++ b/test-mkdtemp.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ char dirname[] = "/tmp/temp.XXXXXX";
+
+ if (mkdtemp(dirname) != dirname)
+ return 1;
+ return rmdir(dirname) == -1;
+}