Commit 391269b5 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

page-server: close server socket only in the parent task

Fixes: e47eccb1 ("page-server: don't forget to close a sever socket")
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7cb829b7
...@@ -307,12 +307,12 @@ int cr_page_server(bool daemon_mode, int cfd) ...@@ -307,12 +307,12 @@ int cr_page_server(bool daemon_mode, int cfd)
no_server: no_server:
if (daemon_mode) { if (daemon_mode) {
ret = cr_daemon(1, 0, &ask, cfd); ret = cr_daemon(1, 0, &ask, cfd);
close_safe(&sk);
if (ret == -1) { if (ret == -1) {
pr_err("Can't run in the background\n"); pr_err("Can't run in the background\n");
goto out; goto out;
} }
if (ret > 0) { /* parent task, daemon started */ if (ret > 0) { /* parent task, daemon started */
close_safe(&sk);
if (opts.pidfile) { if (opts.pidfile) {
if (write_pidfile(ret) == -1) { if (write_pidfile(ret) == -1) {
pr_perror("Can't write pidfile"); pr_perror("Can't write pidfile");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment