libxl: libxl__ev_child pass actual pid to callback
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 23 Jun 2015 18:22:07 +0000 (19:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 26 Jun 2015 15:53:51 +0000 (16:53 +0100)
The callbacks actually ignore this except for logging, but we should
log the correct pid.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
v4: New patch in this version of the series.

tools/libxl/libxl_fork.c

index 144208aef23d4ae2e1c17ac0742b32e035468a54..44866872b91b86b755b86ad2f0e990390ec737d1 100644 (file)
@@ -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)