[v4,1/3] criu service: support status-fd

Submitted by Adrian Reber on June 28, 2018, 9:03 a.m.

Details

Message ID 1530176637-12620-1-git-send-email-adrian@lisas.de
State Accepted
Series "tests: fix builds on alpine and centos"
Commit 154ff016d08af278689b64a0848d68fe6bd0008c
Headers show

Commit Message

Adrian Reber June 28, 2018, 9:03 a.m.
From: Adrian Reber <areber@redhat.com>

Make the --status-fd option also work in 'criu service' mode to avoid
race conditions during testing.

Signed-off-by: Adrian Reber <areber@redhat.com>
---
 criu/cr-service.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/cr-service.c b/criu/cr-service.c
index 274ff21..3a07d5b 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -1206,6 +1206,9 @@  int cr_service(bool daemon_mode)
 	if (setup_sigchld_handler())
 		goto err;
 
+	if (close_status_fd())
+		return -1;
+
 	while (1) {
 		int sk;