[v3,22/33] proc: Close CR_PROC_FD_OFF and TRANSPORT_FD_OFF later

Submitted by Kirill Tkhai on Feb. 16, 2017, 12:09 p.m.

Details

Message ID 148724698989.22444.4707531811185394522.stgit@localhost.localdomain
State New
Series "Nested user namespaces support"
Headers show

Commit Message

Kirill Tkhai Feb. 16, 2017, 12:09 p.m.
CR_PROC_FD_OFF is need for accessing to foreign tasks
fds, and will be used in the future.

TRANSPORT_FD_OFF is for uniformity.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/cr-restore.c |    2 ++
 criu/files.c      |    1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index f66e4cd8d..57926a6e0 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -3251,6 +3251,8 @@  static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
 
 	close_image_dir();
 	close_proc();
+	close_service_fd(TRANSPORT_FD_OFF);
+	close_service_fd(CR_PROC_FD_OFF);
 	close_service_fd(ROOT_FD_OFF);
 	close_service_fd(USERNSD_SK);
 	close_service_fd(FDSTORE_SK_OFF);
diff --git a/criu/files.c b/criu/files.c
index a114e1847..53c4bcc9c 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -1203,7 +1203,6 @@  int prepare_fds(struct pstree_item *me)
 	if (rsti(me)->fdt)
 		futex_inc_and_wake(&rsti(me)->fdt->fdt_lock);
 out:
-	close_service_fd(CR_PROC_FD_OFF);
 	tty_fini_fds();
 	return ret;
 }