From 0570c92a7233ab3e4872d2444e81a5ee6c953209 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 15 Jun 2006 21:15:38 +0000 Subject: Rename the E_IS_SELECT_STATUS_INTR() portability macro to 2006-06-16 Tor Lillqvist * libedataserver/e-msgport.c: Rename the E_IS_SELECT_STATUS_INTR() portability macro to E_IS_STATUS_INTR() as it isn't spefic to select(). (e_msgport_put, e_msgport_wait, e_msgport_get): Use E_IS_STATUS_INTR() instead of looking at errno directly. On Win32 the socket functions don't touch errno. (And there is no EINTR style error possible in WinSock 2 anyway, according to MSDN.) --- ChangeLog | 10 ++++++++++ libedataserver/e-msgport.c | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba0ea121c..dfdf6bfdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-06-16 Tor Lillqvist + + * libedataserver/e-msgport.c: Rename the E_IS_SELECT_STATUS_INTR() + portability macro to E_IS_STATUS_INTR() as it isn't spefic to + select(). + (e_msgport_put, e_msgport_wait, e_msgport_get): Use + E_IS_STATUS_INTR() instead of looking at errno directly. On Win32 + the socket functions don't touch errno. (And there is no EINTR + style error possible in WinSock 2 anyway, according to MSDN.) + 2006-06-15 Tor Lillqvist * configure.in: Add AM_CONDITIONAL for SUNLDAP (as always false) diff --git a/libedataserver/e-msgport.c b/libedataserver/e-msgport.c index 002e87ab9..f9dda6fc8 100644 --- a/libedataserver/e-msgport.c +++ b/libedataserver/e-msgport.c @@ -56,14 +56,14 @@ #define E_WRITE(socket,buf,nbytes) send(socket,buf,nbytes,0) #define E_IS_SOCKET_ERROR(status) ((status) == SOCKET_ERROR) #define E_IS_INVALID_SOCKET(socket) ((socket) == INVALID_SOCKET) -#define E_IS_SELECT_STATUS_INTR() 0 /* No WSAEINTR errors in WinSock2 */ +#define E_IS_STATUS_INTR() 0 /* No WSAEINTR errors in WinSock2 */ #else #define E_CLOSE(socket) close (socket) #define E_READ(socket,buf,nbytes) read(socket,buf,nbytes) #define E_WRITE(socket,buf,nbytes) write(socket,buf,nbytes) #define E_IS_SOCKET_ERROR(status) ((status) == -1) #define E_IS_INVALID_SOCKET(socket) ((socket) < 0) -#define E_IS_SELECT_STATUS_INTR() (errno == EINTR) +#define E_IS_STATUS_INTR() (errno == EINTR) #endif static int @@ -602,7 +602,7 @@ void e_msgport_put(EMsgPort *mp, EMsg *msg) m(printf("put: have pipe, writing notification to it\n")); do { w = E_WRITE (fd, "E", 1); - } while (w == -1 && errno == EINTR); + } while (w == -1 && E_IS_STATUS_INTR ()); } #ifdef HAVE_NSS @@ -640,7 +640,7 @@ EMsg *e_msgport_wait(EMsgPort *mp) do { FD_ZERO(&rfds); FD_SET(mp->pipe.fd.read, &rfds); - retry = E_IS_SOCKET_ERROR(select(mp->pipe.fd.read+1, &rfds, NULL, NULL, NULL)) && E_IS_SELECT_STATUS_INTR(); + retry = E_IS_SOCKET_ERROR(select(mp->pipe.fd.read+1, &rfds, NULL, NULL, NULL)) && E_IS_STATUS_INTR(); pthread_testcancel(); } while (retry); g_mutex_lock(mp->lock); @@ -691,7 +691,7 @@ EMsg *e_msgport_get(EMsgPort *mp) if (mp->pipe.fd.read != -1) { do { n = E_READ (mp->pipe.fd.read, dummy, 1); - } while (n == -1 && errno == EINTR); + } while (n == -1 && E_IS_STATUS_INTR ()); } #ifdef HAVE_NSS if (mp->prpipe.fd.read != NULL) { -- cgit v1.2.1