From 839b4be584653e671905a8fa772294cca01e44f7 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 3 Jun 2002 12:08:38 +0000 Subject: Protect against EINTR (irix?), see bug #24086. 2002-06-03 Not Zed * e-msgport.c (e_msgport_wait): Protect against EINTR (irix?), see bug #24086. svn path=/trunk/; revision=17074 --- e-util/ChangeLog | 5 +++++ e-util/e-msgport.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 842e78b281..c5714f56c7 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2002-06-03 Not Zed + + * e-msgport.c (e_msgport_wait): Protect against EINTR (irix?), see + bug #24086. + 2002-05-07 Ettore Perazzoli * e-corba-utils.c (e_safe_corba_string_dup): New. diff --git a/e-util/e-msgport.c b/e-util/e-msgport.c index e04fa8dc9a..6fc83588c6 100644 --- a/e-util/e-msgport.c +++ b/e-util/e-msgport.c @@ -201,13 +201,16 @@ EMsg *e_msgport_wait(EMsgPort *mp) mp->condwait--; } else { fd_set rfds; + int retry; m(printf("wait: waitng on pipe\n")); - FD_ZERO(&rfds); - FD_SET(mp->pipe.fd.read, &rfds); g_mutex_unlock(mp->lock); - select(mp->pipe.fd.read+1, &rfds, NULL, NULL, NULL); - pthread_testcancel(); + do { + FD_ZERO(&rfds); + FD_SET(mp->pipe.fd.read, &rfds); + retry = select(mp->pipe.fd.read+1, &rfds, NULL, NULL, NULL) == -1 && errno == EINTR; + pthread_testcancel(); + } while (retry); g_mutex_lock(mp->lock); m(printf("wait: got pipe\n")); } -- cgit