summaryrefslogtreecommitdiff
path: root/src/tmpfiles/tmpfiles.c
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/tmpfiles.c
parent43ad6e31aae7e5d36e8a01968dfdca1d3fedc7fa (diff)
tmpfiles: create directories already with the right label, instead of creating them first, and relabeling them afterwards
Diffstat (limited to 'src/tmpfiles/tmpfiles.c')
-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) {