summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 19:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2014-10-23 21:36:56 +0200
commitf3c80515c191b4447a2b0bc5a582dbffeca4679f (patch)
tree4cff304394e3d2c6436827c44d297d9a6d1726d1 /src
parentecabcf8b6edcc856ec2fd5bd43fc675a8fe04731 (diff)
label: don't try to create labelled directories more than once
Diffstat (limited to 'src')
-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 81bc78c1e7..8b35386706 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -35,24 +35,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;