[CRIU] [PATCH 3/7] mnt: Move ns_fd assignment down in prepare_mnt_ns()

Kirill Tkhai ktkhai at virtuozzo.com
Wed Jun 28 18:54:16 MSK 2017


No functional changes.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/mount.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index 9a08506dd..4274cbd04 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -3040,13 +3040,12 @@ int prepare_mnt_ns(void)
 				pr_perror("Can't restore mntns back");
 				goto err;
 			}
-			nsid->mnt.ns_fd = rst;
-			rst = fd;
-		} else {
-			/* Pin one with a file descriptor */
-			nsid->mnt.ns_fd = fd;
+			SWAP(rst, fd);
 		}
 
+		/* Pin one with a file descriptor */
+		nsid->mnt.ns_fd = fd;
+
 		/* Set its root */
 		path[0] = '/';
 		print_ns_root(nsid, 0, path + 1, sizeof(path) - 1);



More information about the CRIU mailing list