summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-18 00:02:08 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-18 00:09:46 +0200
commit6f04529399a7a59cfe549913349176409a4dc2e3 (patch)
treeafa50de38893e389e6b1090cb086525533a03d54 /src/tmpfiles
parenttmpfiles: w lines should allow following symlinks (diff)
downloadsystemd-6f04529399a7a59cfe549913349176409a4dc2e3.tar.xz
systemd-6f04529399a7a59cfe549913349176409a4dc2e3.zip
tmpfiles: create directories already with the right label, instead of creating them first, and relabeling them afterwards
Diffstat (limited to 'src/tmpfiles')
-rw-r--r--src/tmpfiles/tmpfiles.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 25c2a8c413..97901220e4 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -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) {