c8282c
From 26ec8a9783cc5503a3a8928fa6eba5dd3e86ced1 Mon Sep 17 00:00:00 2001
c8282c
From: Mrunal Patel <mrunalp@gmail.com>
c8282c
Date: Tue, 14 Aug 2018 15:50:04 -0700
c8282c
Subject: [PATCH] Revert "libcontainer/rootfs_linux: minor cleanup"
c8282c
c8282c
This reverts commit 1b27db67f13bccaaa325f8372069e15575988eb9.
c8282c
c8282c
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
c8282c
---
c8282c
 libcontainer/rootfs_linux.go | 3 +--
c8282c
 1 file changed, 1 insertion(+), 2 deletions(-)
c8282c
c8282c
diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go
c8282c
index 7f852efce..cf715d664 100644
c8282c
--- a/libcontainer/rootfs_linux.go
c8282c
+++ b/libcontainer/rootfs_linux.go
c8282c
@@ -46,6 +46,7 @@ func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) {
c8282c
 		return newSystemErrorWithCause(err, "preparing rootfs")
c8282c
 	}
c8282c
 
c8282c
+	setupDev := needsSetupDev(config)
c8282c
 	for _, m := range config.Mounts {
c8282c
 		for _, precmd := range m.PremountCmds {
c8282c
 			if err := mountCmd(precmd); err != nil {
c8282c
@@ -64,8 +65,6 @@ func prepareRootfs(pipe io.ReadWriter, iConfig *initConfig) (err error) {
c8282c
 		}
c8282c
 	}
c8282c
 
c8282c
-	setupDev := needsSetupDev(config)
c8282c
-
c8282c
 	if setupDev {
c8282c
 		if err := createDevices(config); err != nil {
c8282c
 			return newSystemErrorWithCause(err, "creating device nodes")