From: Lennart Poettering Date: Tue, 17 Jun 2014 22:02:08 +0000 (+0200) Subject: tmpfiles: create directories already with the right label, instead of creating them... X-Git-Tag: v215~355 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6f04529399a7a59cfe549913349176409a4dc2e3;p=elogind.git tmpfiles: create directories already with the right label, instead of creating them first, and relabeling them afterwards --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 25c2a8c41..97901220e 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) {