aboutsummaryrefslogtreecommitdiff
path: root/src/paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/paths.c')
-rw-r--r--src/paths.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/paths.c b/src/paths.c
index 5c8121a..d4239ff 100644
--- a/src/paths.c
+++ b/src/paths.c
@@ -1,12 +1,23 @@
#include "paths.h"
+#include "errno.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
+#include "sys/stat.h"
+#include "unistd.h"
char template[] = "/tmp/pow/XXXXXX";
int pow_create_dir_for_package(char **path) {
+ if (mkdir("/tmp/pow", 0700)) {
+ if (errno != EEXIST) {
+ printf("failed to create temp dir\n");
+
+ return 1;
+ }
+ }
+
char *new_path = malloc(strlen(template) + 1);
if (!new_path) {