From 69ba01560f9193dbf4ad2fc8361efb725704807c Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Thu, 25 Jun 2009 17:12:07 -0400 Subject: [PATCH] put poll() calls in loops in case they are interrupted by signals --- libust/tracectl.c | 3 ++- libustcomm/ustcomm.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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; -- 2.34.1