瀏覽代碼

Merge trunk revision 2789:
r2789 | honzaf | 2010-04-26 09:16:20 -0700 (Mon, 26 Apr 2010) | 7 lines

Handle POLLNVAL in coroipcc

Old code in coroipcc doesn't handle POLLNVAL. It can happen, that some
applications (for example fenced) will stuck forever.

Also poll result is now handled more correctly.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/branches/flatiron@2809 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 16 年之前
父節點
當前提交
afe99a55e4
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      lib/coroipcc.c

+ 9 - 2
lib/coroipcc.c

@@ -478,11 +478,18 @@ retry_semwait:
 		pfd.fd = ipc_instance->fd;
 		pfd.events = 0;
 
-		poll (&pfd, 1, 0);
-		if (pfd.revents == POLLERR || pfd.revents == POLLHUP) {
+		res = poll (&pfd, 1, 0);
+
+		if (res == -1 && errno != EINTR) {
 			return (CS_ERR_LIBRARY);
 		}
 
+		if (res == 1) {
+			if (pfd.revents == POLLERR || pfd.revents == POLLHUP || pfd.revents == POLLNVAL) {
+				return (CS_ERR_LIBRARY);
+			}
+		}
+
 		goto retry_semwait;
 	}