1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

smack-util: tiny simplification

This commit is contained in:
Lennart Poettering 2021-09-23 17:08:58 +02:00
parent 3fc0688d42
commit f7c9ade22f

View File

@ -286,14 +286,13 @@ int mac_smack_copy(const char *dest, const char *src) {
#endif #endif
int rename_and_apply_smack_floor_label(const char *from, const char *to) { int rename_and_apply_smack_floor_label(const char *from, const char *to) {
int r = 0;
if (rename(from, to) < 0) if (rename(from, to) < 0)
return -errno; return -errno;
#if HAVE_SMACK_RUN_LABEL #if HAVE_SMACK_RUN_LABEL
r = mac_smack_apply(to, SMACK_ATTR_ACCESS, SMACK_FLOOR_LABEL); return mac_smack_apply(to, SMACK_ATTR_ACCESS, SMACK_FLOOR_LABEL);
if (r < 0) #else
return r; return 0;
#endif #endif
return r;
} }