From b9a6fb9f7735a8a71d8704eb22a72c2f9f4973d5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 16 Apr 2010 13:39:28 +0200 Subject: [PATCH] Invalidate create_pid if create process has died. We're checking create_pid against zero at several places, for example before sending a signal to the create process. So set create_pid is zero in handle_sigchld() if the create process just died. --- dss.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dss.c b/dss.c index da096aa..c45f450 100644 --- a/dss.c +++ b/dss.c @@ -779,18 +779,22 @@ static int handle_sigchld(void) if (pid == create_pid) { switch (snapshot_creation_status) { case HS_PRE_RUNNING: - return handle_pre_create_hook_exit(status); + ret = handle_pre_create_hook_exit(status); + break; case HS_RUNNING: - return handle_rsync_exit(status); + ret = handle_rsync_exit(status); + break; case HS_POST_RUNNING: snapshot_creation_status = HS_READY; - return 1; + ret = 1; + break; default: DSS_EMERG_LOG("BUG: create can't die in status %d\n", snapshot_creation_status); return -E_BUG; } create_pid = 0; + return ret; } if (pid == remove_pid) { ret = handle_remove_exit(status); -- 2.39.2