summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 19:41:56 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-10-25 18:54:30 -0400
commitc73ca2c9bd67b8ee8b5bca447604a22b02ab4c7e (patch)
tree5e3f1463f88f95efb1e293c682fd1eae0457b4c9 /src/shared
parenta7a23d465df41d67197752675f53c4b59b660813 (diff)
label: don't try to create labelled directories more than once
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/mkdir-label.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index 1b16c3bd72..832e3df4d9 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -33,24 +33,19 @@
static int label_mkdir(const char *path, mode_t mode) {
int r;
- if (mac_selinux_use()) {
- r = mac_selinux_mkdir(path, mode);
- if (r < 0)
- return r;
- }
+ if (mac_selinux_use())
+ return mac_selinux_mkdir(path, mode);
if (mac_smack_use()) {
r = mkdir(path, mode);
- if (r < 0 && errno != EEXIST)
+ if (r < 0)
return -errno;
- r = mac_smack_fix(path, false, false);
- if (r < 0)
- return r;
+ return mac_smack_fix(path, false, false);
}
r = mkdir(path, mode);
- if (r < 0 && errno != EEXIST)
+ if (r < 0)
return -errno;
return 0;