| Server IP : 82.208.35.60 / Your IP : 216.73.217.39 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/sysutils/mcelog/files/ |
Upload File : |
--- eventloop.c.orig 2016-02-10 18:38:43 UTC
+++ eventloop.c
@@ -38,7 +38,9 @@ struct pollcb {
static struct pollfd pollfds[MAX_POLLFD];
static struct pollcb pollcbs[MAX_POLLFD];
+#ifdef __Linux__
static sigset_t event_sigs;
+#endif
static int closeonexec(int fd)
{
@@ -97,6 +99,7 @@ static void poll_callbacks(int n)
}
/* Run signal handler only directly after event loop */
+#ifdef __Linux__
int event_signal(int sig)
{
static int first = 1;
@@ -126,17 +129,25 @@ static int ppoll_fallback(struct pollfd
static int (*ppoll_vec)(struct pollfd *, nfds_t, const struct timespec
*, const sigset_t *);
+#endif
void eventloop(void)
{
+#ifdef __Linux__
#if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 5 || __GLIBC__ > 2
ppoll_vec = ppoll;
#endif
if (!ppoll_vec)
ppoll_vec = ppoll_fallback;
+#endif
for (;;) {
+#ifdef __Linux__
int n = ppoll_vec(pollfds, max_pollfd, NULL, &event_sigs);
+#endif
+#ifdef __FreeBSD__
+ int n = poll(pollfds, max_pollfd, -1);
+#endif
if (n <= 0) {
if (n < 0 && errno != EINTR)
SYSERRprintf("poll error");