aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-05-11 18:59:02 +0100
committerIan Jackson <ian.jackson@eu.citrix.com>2012-05-11 18:59:02 +0100
commit97adb792789d187bbc48a3c1046ce02bcca3768d (patch)
tree3a09ba49f78a928660281d6849b149d23da55d02 /tools/libxl
parent17ecbf8fed795c3d61b107b65200094ba259f14c (diff)
downloadxen-97adb792789d187bbc48a3c1046ce02bcca3768d.tar.gz
xen-97adb792789d187bbc48a3c1046ce02bcca3768d.tar.bz2
xen-97adb792789d187bbc48a3c1046ce02bcca3768d.zip
libxl: remove ctx->waitpid_instead
Remove this obsolete hook. Callers inside libxl which create and reap children should use the mechanisms provided by the event system. (This has no functional difference since there is no way for ctx->waitpid_instead ever to become set.) Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl')
-rw-r--r--tools/libxl/libxl_exec.c12
-rw-r--r--tools/libxl/libxl_internal.h3
2 files changed, 3 insertions, 12 deletions
diff --git a/tools/libxl/libxl_exec.c b/tools/libxl/libxl_exec.c
index b10e79f03d..2ee2154e77 100644
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -19,11 +19,6 @@
#include "libxl_internal.h"
-static int call_waitpid(pid_t (*waitpid_cb)(pid_t, int *, int), pid_t pid, int *status, int options)
-{
- return (waitpid_cb) ? waitpid_cb(pid, status, options) : waitpid(pid, status, options);
-}
-
static void check_open_fds(const char *what)
{
const char *env_debug;
@@ -344,7 +339,7 @@ int libxl__spawn_spawn(libxl__gc *gc,
if (!for_spawn) _exit(0); /* just detach then */
- got = call_waitpid(ctx->waitpid_instead, child, &status, 0);
+ got = waitpid(child, &status, 0);
assert(got == child);
rc = (WIFEXITED(status) ? WEXITSTATUS(status) :
@@ -404,7 +399,7 @@ int libxl__spawn_detach(libxl__gc *gc,
(unsigned long)for_spawn->intermediate);
abort(); /* things are very wrong */
}
- got = call_waitpid(ctx->waitpid_instead, for_spawn->intermediate, &status, 0);
+ got = waitpid(for_spawn->intermediate, &status, 0);
assert(got == for_spawn->intermediate);
if (!(WIFSIGNALED(status) && WTERMSIG(status) == SIGKILL)) {
report_spawn_intermediate_status(gc, for_spawn, status);
@@ -421,14 +416,13 @@ int libxl__spawn_detach(libxl__gc *gc,
int libxl__spawn_check(libxl__gc *gc, libxl__spawn_starting *for_spawn)
{
- libxl_ctx *ctx = libxl__gc_owner(gc);
pid_t got;
int status;
if (!for_spawn) return 0;
assert(for_spawn->intermediate);
- got = call_waitpid(ctx->waitpid_instead, for_spawn->intermediate, &status, WNOHANG);
+ got = waitpid(for_spawn->intermediate, &status, WNOHANG);
if (!got) return 0;
assert(got == for_spawn->intermediate);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 21fe99c839..6fb99f6660 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -325,9 +325,6 @@ struct libxl__ctx {
int sigchld_selfpipe[2]; /* [0]==-1 means handler not installed */
LIBXL_LIST_HEAD(, libxl__ev_child) children;
- /* This is obsolete and must be removed: */
- int (*waitpid_instead)(pid_t pid, int *status, int flags);
-
libxl_version_info version_info;
};