From 2231205419d38024f65a8e4066e34d204f5ce13a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 16 Jan 2014 16:40:05 +0000 Subject: [PATCH] libxl: fork: Break out childproc_reaped_ours 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 2252370a11..7b84765bd1 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); -- 2.39.5