From cdb84528052269bfb211ccba4ad3de27ebb56b65 Mon Sep 17 00:00:00 2001 From: Fabien Thomas Date: Thu, 23 Nov 2006 08:49:21 +0000 Subject: [PATCH] handle case where POLLHUP or POLLERR are not supported by OS git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1311 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/ipc.c | 6 ++++++ lib/util.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/exec/ipc.c b/exec/ipc.c index 253c5b70..61efb889 100644 --- a/exec/ipc.c +++ b/exec/ipc.c @@ -770,6 +770,12 @@ retry_recv: return; } else if (res == 0) { +#if defined(OPENAIS_SOLARIS) || defined(OPENAIS_BSD) || defined(OPENAIS_DARWIN) + /* On many OS poll never return POLLHUP or POLLERR. + * EOF is detected when recvmsg return 0. + */ + libais_disconnect_request (conn_info); +#endif return; } diff --git a/lib/util.c b/lib/util.c index 94ca6ee2..99eefdde 100644 --- a/lib/util.c +++ b/lib/util.c @@ -260,7 +260,7 @@ retry_recv: * EOF is detected when recvmsg return 0. */ if (result == 0) { - error = SA_AIS_ERR_BAD_HANDLE; + error = SA_AIS_ERR_LIBRARY; goto error_exit; } #endif