mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-26 22:18:03 +00:00
uis.c: don't infloop upon poll failure (e.g., ENOMEM)
* lcr/uis.c (lcr_uis_server): Return NULL for any poll failure other than EINTR. This also avoids a warning. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1964 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
4e8e8deafb
commit
1447cfd8e9
10
lcr/uis.c
10
lcr/uis.c
@ -153,7 +153,6 @@ static void *lcr_uis_server (void *data)
|
||||
#ifdef COROSYNC_LINUX
|
||||
int on = 1;
|
||||
#endif
|
||||
int res;
|
||||
|
||||
/*
|
||||
* Main acceptance and dispatch loop
|
||||
@ -163,7 +162,11 @@ static void *lcr_uis_server (void *data)
|
||||
ufds[0].events = POLLIN;
|
||||
ufds[1].events = POLLOUT;
|
||||
for (;;) {
|
||||
res = poll (ufds, nfds, -1);
|
||||
int res = poll (ufds, nfds, -1);
|
||||
if (res == 0 || (res < 0 && errno == EINTR))
|
||||
continue;
|
||||
if (res < 0)
|
||||
return NULL;
|
||||
if (nfds == 1 && ufds[0].revents & POLLIN) {
|
||||
ufds[1].fd = accept (ufds[0].fd,
|
||||
(struct sockaddr *)&un_addr, &addrlen);
|
||||
@ -177,9 +180,6 @@ static void *lcr_uis_server (void *data)
|
||||
lcr_uis_dispatch (ufds[1].fd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__attribute__ ((constructor)) static int lcr_uis_ctors (void)
|
||||
|
Loading…
Reference in New Issue
Block a user