summaryrefslogtreecommitdiff
path: root/sysutils/mcelog/files/patch-eventloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/mcelog/files/patch-eventloop.c')
-rw-r--r--sysutils/mcelog/files/patch-eventloop.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/sysutils/mcelog/files/patch-eventloop.c b/sysutils/mcelog/files/patch-eventloop.c
new file mode 100644
index 000000000000..e9d47c4640cc
--- /dev/null
+++ b/sysutils/mcelog/files/patch-eventloop.c
@@ -0,0 +1,38 @@
+--- ./eventloop.c.orig 2009-12-15 07:18:40.000000000 -0500
++++ ./eventloop.c 2011-10-14 22:36:47.000000000 -0400
+@@ -38,7 +38,9 @@
+ 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 @@
+ }
+
+ /* Run signal handler only directly after event loop */
++#ifdef __Linux__
+ int event_signal(int sig)
+ {
+ static int first = 1;
+@@ -111,11 +114,17 @@
+ return -1;
+ return 0;
+ }
++#endif
+
+ void eventloop(void)
+ {
+ for (;;) {
++#ifdef __Linux__
+ int n = ppoll(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");