[CRIU] [PATCH] page-server: close server socket only in the parent task

Andrey Vagin avagin at openvz.org
Wed Nov 5 05:33:07 PST 2014


Fixes: e47eccb1889f ("page-server: don't forget to close a sever socket")
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 page-xfer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/page-xfer.c b/page-xfer.c
index f56448c..86e26d8 100644
--- a/page-xfer.c
+++ b/page-xfer.c
@@ -307,12 +307,12 @@ int cr_page_server(bool daemon_mode, int cfd)
 no_server:
 	if (daemon_mode) {
 		ret = cr_daemon(1, 0, &ask, cfd);
-		close_safe(&sk);
 		if (ret == -1) {
 			pr_err("Can't run in the background\n");
 			goto out;
 		}
 		if (ret > 0) { /* parent task, daemon started */
+			close_safe(&sk);
 			if (opts.pidfile) {
 				if (write_pidfile(ret) == -1) {
 					pr_perror("Can't write pidfile");
-- 
1.9.3



More information about the CRIU mailing list