Cleanup ctl.c

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-01-16 16:45:59 +00:00
parent 70086d295a
commit aeedc361c0

View File

@@ -3,7 +3,6 @@
#include "ctl.h" #include "ctl.h"
#include "str.h" #include "str.h"
#include <stdio.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/un.h> #include <sys/un.h>
@@ -16,10 +15,8 @@ ctl_init(const char *dir, const char *file)
return -1; return -1;
} }
if (mkdir(dir, 0700) == -1 && errno != EEXIST) { if (mkdir(dir, 0700) == -1 && errno != EEXIST)
perror("mkdir");
return -1; return -1;
}
const char *strs[] = {dir, "/", file}; const char *strs[] = {dir, "/", file};
char *path = str_cat(strs, 3); char *path = str_cat(strs, 3);