poorman: handle EINTR on poll()

Change-Id: I549db55a408063bbddf71d5ce15c0286bf36bc69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3727
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
This commit is contained in:
Jérôme Duval 2021-02-01 18:48:51 +01:00
parent 0ce3a760d3
commit 08b9db66ac

View File

@ -8,6 +8,7 @@
#include "PoorManServer.h"
#include <errno.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
@ -226,6 +227,8 @@ int32 PoorManServer::_Listener(void* data)
while (s->fIsRunning) {
// Wait for listen4_fd or listen6_fd (or both!) to become ready:
retval = poll(fds, nfds, -1);
if (retval == -1 && errno == EINTR)
continue;
if (retval < 1) {
return -1; // fds no longer available
}