summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;