chiark / gitweb /
cgroup: kill processes, not tasks and other cgroup changes
[elogind.git] / src / util.c
index fa3969b7051e04a248e4034e4af6f995aa081aa3..69eb14be615f656609dbe383c9956875c8da97c9 100644 (file)
@@ -956,7 +956,6 @@ int mkdir_parents(const char *path, mode_t mode) {
                         return -ENOMEM;
 
                 r = mkdir(t, mode);
-
                 free(t);
 
                 if (r < 0 && errno != EEXIST)
@@ -972,7 +971,7 @@ int mkdir_p(const char *path, mode_t mode) {
         if ((r = mkdir_parents(path, mode)) < 0)
                 return r;
 
-        if (mkdir(path, mode) < 0)
+        if (mkdir(path, mode) < 0 && errno != EEXIST)
                 return -errno;
 
         return 0;