From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [PATCH 02/12] libxl: fork: Break out childproc_reaped_ours Date: Fri, 17 Jan 2014 16:23:55 +0000 Message-ID: <1389975845-1195-3-git-send-email-ian.jackson@eu.citrix.com> References: <1389975845-1195-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1389975845-1195-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Jim Fehlig , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We're going to want to do this again at a new call site. No functional change. Signed-off-by: Ian Jackson Cc: Jim Fehlig Cc: Ian Campbell Acked-by: Ian Campbell --- tools/libxl/libxl_fork.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c index 2252370..7b84765 100644 --- a/tools/libxl/libxl_fork.c +++ b/tools/libxl/libxl_fork.c @@ -290,6 +290,14 @@ static int perhaps_installhandler(libxl__gc *gc, bool creating) return 0; } +static void childproc_reaped_ours(libxl__egc *egc, libxl__ev_child *ch, + int status) +{ + LIBXL_LIST_REMOVE(ch, entry); + ch->pid = -1; + ch->callback(egc, ch, ch->pid, status); +} + static int childproc_reaped(libxl__egc *egc, pid_t pid, int status) { EGC_GC; @@ -303,9 +311,7 @@ static int childproc_reaped(libxl__egc *egc, pid_t pid, int status) return ERROR_UNKNOWN_CHILD; found: - LIBXL_LIST_REMOVE(ch, entry); - ch->pid = -1; - ch->callback(egc, ch, pid, status); + childproc_reaped_ours(egc, ch, status); perhaps_removehandler(gc); -- 1.7.10.4