diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-10-23 19:41:56 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-10-25 18:54:30 -0400 |
commit | c73ca2c9bd67b8ee8b5bca447604a22b02ab4c7e (patch) | |
tree | 5e3f1463f88f95efb1e293c682fd1eae0457b4c9 /src/shared/mkdir-label.c | |
parent | a7a23d465df41d67197752675f53c4b59b660813 (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/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 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; |