]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
namespace: get rid of local variable
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Mar 2019 15:49:57 +0000 (16:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Mar 2019 18:33:55 +0000 (19:33 +0100)
src/core/namespace.c

index 48517cb06ed35c775a45ae50ac0fd6fe4da6497e..8997fc170b81fa45d10809c33eecf5bb01f1fdbc 100644 (file)
@@ -1044,11 +1044,10 @@ static int apply_mount(
 
 /* Change the per-mount readonly flag on an existing mount */
 static int remount_bind_readonly(const char *path, unsigned long orig_flags) {
-        int r;
-
-        r = mount(NULL, path, NULL, MS_REMOUNT | MS_BIND | MS_RDONLY | orig_flags, NULL);
+        if (mount(NULL, path, NULL, MS_REMOUNT | MS_BIND | MS_RDONLY | orig_flags, NULL) < 0)
+                return -errno;
 
-        return r < 0 ? -errno : 0;
+        return 0;
 }
 
 static int make_read_only(const MountEntry *m, char **blacklist, FILE *proc_self_mountinfo) {