Socat failed to compile when no poll() system call was found

This commit is contained in:
Gerhard Rieger 2019-09-08 20:22:50 +02:00
parent 5ebf36038f
commit 72a137c287
3 changed files with 7 additions and 2 deletions

View file

@ -11,6 +11,10 @@ Corrections:
This affected version 1.7.3.3 only. This affected version 1.7.3.3 only.
Thanks to Ivan J. for reporting this issue. Thanks to Ivan J. for reporting this issue.
Socat failed to compile when no poll() system call was found by
configure.
Thanks to Jason White for sending a patch.
####################### V 1.7.3.3: ####################### V 1.7.3.3:
Corrections: Corrections:

View file

@ -144,6 +144,7 @@ int filan_fd(int fd, FILE *outfile) {
|POLLMSG |POLLMSG
#endif #endif
; ;
#if HAVE_POLL
if (Poll(&ufds, 1, 0) < 0) { if (Poll(&ufds, 1, 0) < 0) {
Warn4("poll({%d, %hd, %hd}, 1, 0): %s", Warn4("poll({%d, %hd, %hd}, 1, 0): %s",
ufds.fd, ufds.events, ufds.revents, strerror(errno)); ufds.fd, ufds.events, ufds.revents, strerror(errno));
@ -200,6 +201,7 @@ int filan_fd(int fd, FILE *outfile) {
} }
#endif /* _WITH_SOCKET && defined(MSG_DONTWAIT) */ #endif /* _WITH_SOCKET && defined(MSG_DONTWAIT) */
} }
#endif /* HAVE_POLL */
} }
} }
fputc('\n', outfile); fputc('\n', outfile);

View file

@ -538,8 +538,8 @@ int xiopoll(struct pollfd fds[], unsigned long nfds, struct timeval *timeout) {
} }
return result; return result;
} }
#if HAVE_POLL
{ {
#if HAVE_POLL
int ms = 0; int ms = 0;
if (timeout == NULL) { if (timeout == NULL) {
ms = -1; ms = -1;
@ -549,7 +549,6 @@ int xiopoll(struct pollfd fds[], unsigned long nfds, struct timeval *timeout) {
/*! timeout */ /*! timeout */
return Poll(fds, nfds, ms); return Poll(fds, nfds, ms);
#else /* HAVE_POLL */ #else /* HAVE_POLL */
} else {
Error("poll() not available"); Error("poll() not available");
return -1; return -1;
#endif /* !HAVE_POLL */ #endif /* !HAVE_POLL */