From: Roger Pau Monne Subject: [PATCH 5/9] libxl: react correctly to POLLHUP Date: Wed, 11 Jul 2012 11:23:48 +0100 Message-ID: <1342002232-75531-6-git-send-email-roger.pau@citrix.com> References: <1342002232-75531-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1342002232-75531-1-git-send-email-roger.pau@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: xen-devel@lists.xen.org Cc: Ian Jackson , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On datacopier_readable ignore PULLHUP, since we will shortly process the death of the underlying process. Cc: Ian Jackson Signed-off-by: Roger Pau Monne --- tools/libxl/libxl_aoutils.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c index 99972a2..fa07154 100644 --- a/tools/libxl/libxl_aoutils.c +++ b/tools/libxl/libxl_aoutils.c @@ -102,6 +102,14 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev, libxl__datacopier_state *dc = CONTAINER_OF(ev, *dc, toread); STATE_AO_GC(dc->ao); + if (revents & POLLHUP) { + LOG(DEBUG, "received POLLHUP on %s during copy of %s, " + "waiting for process to die", + dc->readwhat, dc->copywhat); + libxl__ev_fd_deregister(gc, &dc->toread); + return; + } + if (revents & ~POLLIN) { LOG(ERROR, "unexpected poll event 0x%x (should be POLLIN)" " on %s during copy of %s", revents, dc->readwhat, dc->copywhat); -- 1.7.7.5 (Apple Git-26)