From: Ian Jackson Date: Thu, 27 Nov 2014 18:03:03 +0000 (+0000) Subject: libxl: events: Deregister, don't just modify, sigchld pipe fd X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4020 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4b9143e4a447789fab45162edd9cbf00512b88a9;p=xen.git libxl: events: Deregister, don't just modify, sigchld pipe fd We want to have no fd events registered when we are idle. This implies that we must be able to deregister our interest in the sigchld self-pipe fd, not just modify to request no events. Signed-off-by: Ian Jackson Acked-by: Ian Campbell Tested-by: Ian Campbell Release-Acked-by: Konrad Rzeszutek Wilk --- diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c index fa150959ad..144208aef2 100644 --- a/tools/libxl/libxl_fork.c +++ b/tools/libxl/libxl_fork.c @@ -372,15 +372,8 @@ static void sigchld_user_remove(libxl_ctx *ctx) /* idempotent */ void libxl__sigchld_notneeded(libxl__gc *gc) /* non-reentrant, idempotent */ { - int rc; - sigchld_user_remove(CTX); - - if (libxl__ev_fd_isregistered(&CTX->sigchld_selfpipe_efd)) { - rc = libxl__ev_fd_modify(gc, &CTX->sigchld_selfpipe_efd, 0); - if (rc) - libxl__ev_fd_deregister(gc, &CTX->sigchld_selfpipe_efd); - } + libxl__ev_fd_deregister(gc, &CTX->sigchld_selfpipe_efd); } int libxl__sigchld_needed(libxl__gc *gc) /* non-reentrant, idempotent */