From: Pierre-Marc Fournier Date: Thu, 25 Jun 2009 21:12:07 +0000 (-0400) Subject: put poll() calls in loops in case they are interrupted by signals X-Git-Tag: v0.1~183 X-Git-Url: http://git.lttng.org/?p=ust.git;a=commitdiff_plain;h=69ba01560f9193dbf4ad2fc8361efb725704807c put poll() calls in loops in case they are interrupted by signals --- diff --git a/libust/tracectl.c b/libust/tracectl.c index a68dc7b..5ccd1f5 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -164,7 +164,8 @@ void process_blocked_consumers(void) idx++; } - result = poll(fds, n_fds, 0); + while((result = poll(fds, n_fds, 0)) == -1 && errno == EINTR) + /* nothing */; if(result == -1) { PERROR("poll"); return; diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 225d199..0a5ab6a 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -272,7 +272,8 @@ int ustcomm_recv_message(struct ustcomm_server *server, char **msg, struct ustco idx++; } - result = poll(fds, n_fds, timeout); + while((result = poll(fds, n_fds, timeout)) == -1 && errno == EINTR) + /* nothing */; if(result == -1) { PERROR("poll"); return -1;