From 39e91a2777e0ff93f0e9f39066eb7c32b949fdd0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 25 Mar 2019 16:49:57 +0100 Subject: [PATCH] namespace: get rid of local variable --- src/core/namespace.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/namespace.c b/src/core/namespace.c index 48517cb06e..8997fc170b 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -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; + if (mount(NULL, path, NULL, MS_REMOUNT | MS_BIND | MS_RDONLY | orig_flags, NULL) < 0) + return -errno; - r = mount(NULL, path, NULL, MS_REMOUNT | MS_BIND | MS_RDONLY | orig_flags, NULL); - - return r < 0 ? -errno : 0; + return 0; } static int make_read_only(const MountEntry *m, char **blacklist, FILE *proc_self_mountinfo) {