]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
smack-util: tiny simplification
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Sep 2021 15:08:58 +0000 (17:08 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Sep 2021 19:15:46 +0000 (21:15 +0200)
src/shared/smack-util.c

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