4
0
Эх сурвалжийг харах

cov 10373: check poll return value

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2844 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld 15 жил өмнө
parent
commit
b1d84f9ecc
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      lib/coroipcc.c

+ 5 - 1
lib/coroipcc.c

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