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

Submitted by Adrian Reber on June 28, 2018, 12:43 p.m.

Details

Message ID 1530189809-26295-1-git-send-email-adrian@lisas.de
State New
Series "tests: fix builds on alpine and centos"
Headers show

Commit Message

Adrian Reber June 28, 2018, 12:43 p.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;
 

Comments

Andrey Vagin June 28, 2018, 10:07 p.m.
Applied, thanks.

Pls, don't send a new series as a replay, patchwork failed to handle
this.

On Thu, Jun 28, 2018 at 12:43:27PM +0000, Adrian Reber wrote:
> 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(+)
> 
> 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;
>  
> -- 
> 1.8.3.1
>