aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test-mkdtemp.c
diff options
context:
space:
mode:
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 00000000..8e1c46ca
--- /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);
+}