chiark / gitweb /
tmpfiles: create directories already with the right label, instead of creating them...
authorLennart Poettering <lennart@poettering.net>
Tue, 17 Jun 2014 22:02:08 +0000 (00:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Jun 2014 22:09:46 +0000 (00:09 +0200)
src/tmpfiles/tmpfiles.c

index 25c2a8c..9790122 100644 (file)
@@ -691,12 +691,12 @@ static int create_item(Item *i) {
 
                 RUN_WITH_UMASK(0000) {
                         mkdir_parents_label(i->path, 0755);
-                        r = mkdir(i->path, i->mode);
+                        r = mkdir_label(i->path, i->mode);
                 }
 
-                if (r < 0 && errno != EEXIST) {
-                        log_error("Failed to create directory %s: %m", i->path);
-                        return -errno;
+                if (r < 0 && r != -EEXIST) {
+                        log_error("Failed to create directory %s: %s", i->path, strerror(-r));
+                        return r;
                 }
 
                 if (stat(i->path, &st) < 0) {