From: Wei Liu Subject: Re: [PATCH 34/35] libxl: libxl__ev_child pass actual pid to callback Date: Fri, 26 Jun 2015 15:56:11 +0100 Message-ID: <20150626145611.GJ6265@zion.uk.xensource.com> References: <1435254275-8184-1-git-send-email-ian.jackson@eu.citrix.com> <1435254275-8184-35-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: Content-Disposition: inline In-Reply-To: <1435254275-8184-35-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: Ian Jackson Cc: Wei Liu , xen-devel@lists.xensource.com, Euan Harris , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Thu, Jun 25, 2015 at 06:44:34PM +0100, Ian Jackson wrote: > The callbacks actually ignore this except for logging, but we should > log the correct pid. > > Signed-off-by: Ian Jackson Acked-by: Wei Liu > --- > v4: New patch in this version of the series. > --- > tools/libxl/libxl_fork.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c > index 144208a..4486687 100644 > --- a/tools/libxl/libxl_fork.c > +++ b/tools/libxl/libxl_fork.c > @@ -447,9 +447,10 @@ static int perhaps_sigchld_needed(libxl__gc *gc, bool creating) > static void childproc_reaped_ours(libxl__egc *egc, libxl__ev_child *ch, > int status) > { > + pid_t pid = ch->pid; > LIBXL_LIST_REMOVE(ch, entry); > ch->pid = -1; > - ch->callback(egc, ch, ch->pid, status); > + ch->callback(egc, ch, pid, status); > } > > static int childproc_reaped(libxl__egc *egc, pid_t pid, int status) > -- > 1.7.10.4