diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-10-23 19:41:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-10-23 21:36:56 +0200 |
commit | f3c80515c191b4447a2b0bc5a582dbffeca4679f (patch) | |
tree | 4cff304394e3d2c6436827c44d297d9a6d1726d1 /src/shared/mkdir-label.c | |
parent | ecabcf8b6edcc856ec2fd5bd43fc675a8fe04731 (diff) |
label: don't try to create labelled directories more than once
Diffstat (limited to 'src/shared/mkdir-label.c')
-rw-r--r-- | src/shared/mkdir-label.c | 15 |
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; |