summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-07-18 15:58:42 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-21 15:04:36 -0400
commitd403aca70a07e1401cb93738f1af5961582a2e47 (patch)
tree76cc3083a096b248f4bda0477be04d9cb0b8f2ed
parent711c36558f50943c8342f25ad210281134887a3d (diff)
Switch poll() users to xserver_poll()
This uses the wrapper in case we need to emulate poll with select as we do on Windows. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/dmx/input/lnx-ms.c4
-rw-r--r--hw/dmx/input/lnx-ps2.c4
-rw-r--r--hw/kdrive/linux/mouse.c6
-rw-r--r--hw/kdrive/linux/ms.c4
-rw-r--r--hw/kdrive/linux/ps2.c4
-rw-r--r--hw/xfree86/drivers/modesetting/present.c4
-rw-r--r--hw/xfree86/drivers/modesetting/vblank.c1
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c8
-rw-r--r--hw/xfree86/os-support/shared/sigio.c4
-rw-r--r--hw/xfree86/os-support/solaris/sun_bell.c4
10 files changed, 21 insertions, 22 deletions
diff --git a/hw/dmx/input/lnx-ms.c b/hw/dmx/input/lnx-ms.c
index c7a09cab7..1a5786c7e 100644
--- a/hw/dmx/input/lnx-ms.c
+++ b/hw/dmx/input/lnx-ms.c
@@ -76,7 +76,7 @@
#include <X11/Xos.h>
#include <errno.h>
#include <termios.h>
-#include <poll.h>
+#include <xserver_poll.h>
/*****************************************************************************/
/* Define some macros to make it easier to move this file to another
@@ -135,7 +135,7 @@ msLinuxReadBytes(int fd, unsigned char *buf, int len, int min)
}
if (tot % min == 0)
break;
- n = poll(&poll_fd, 1, 100);
+ n = xserver_poll(&poll_fd, 1, 100);
if (n <= 0)
break;
}
diff --git a/hw/dmx/input/lnx-ps2.c b/hw/dmx/input/lnx-ps2.c
index 00ccc014e..2b6e8d63b 100644
--- a/hw/dmx/input/lnx-ps2.c
+++ b/hw/dmx/input/lnx-ps2.c
@@ -73,7 +73,7 @@
#include <X11/Xos.h>
#include <errno.h>
#include <termios.h>
-#include <poll.h>
+#include <xserver_poll.h>
/*****************************************************************************/
/* Define some macros to make it easier to move this file to another
@@ -131,7 +131,7 @@ ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min)
}
if (tot % min == 0)
break;
- n = poll(&poll_fd, 1, 100);
+ n = xserver_poll(&poll_fd, 1, 100);
if (n <= 0)
break;
}
diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c
index 3508b1761..6bdd28651 100644
--- a/hw/kdrive/linux/mouse.c
+++ b/hw/kdrive/linux/mouse.c
@@ -27,7 +27,7 @@
#include <termios.h>
#include <X11/X.h>
#include <X11/Xproto.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include "inputstr.h"
#include "scrnintstr.h"
#include "kdrive.h"
@@ -55,7 +55,7 @@ MouseWaitForReadable(int fd, int timeout)
poll_fd.fd = fd;
poll_fd.events = POLLIN;
for (;;) {
- n = poll(&poll_fd, 1, timeout);
+ n = xserver_poll(&poll_fd, 1, timeout);
if (n > 0)
return TRUE;
if (n < 0 && (errno == EAGAIN || errno == EINTR)) {
@@ -136,7 +136,7 @@ MouseWaitForWritable(int fd, int timeout)
poll_fd.fd = fd;
poll_fd.events = POLLOUT;
- n = poll(&poll_fd, 1, timeout);
+ n = xserver_poll(&poll_fd, 1, timeout);
if (n > 0)
return TRUE;
return FALSE;
diff --git a/hw/kdrive/linux/ms.c b/hw/kdrive/linux/ms.c
index 79e6373dd..3934682ad 100644
--- a/hw/kdrive/linux/ms.c
+++ b/hw/kdrive/linux/ms.c
@@ -26,7 +26,7 @@ THE SOFTWARE.
#endif
#include <errno.h>
#include <termios.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include "inputstr.h"
@@ -51,7 +51,7 @@ MsReadBytes(int fd, char *buf, int len, int min)
}
if (tot % min == 0)
break;
- n = poll(&poll_fd, 1, 100);
+ n = xserver_poll(&poll_fd, 1, 100);
if (n <= 0)
break;
}
diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c
index 5d4a8eb33..4fec02408 100644
--- a/hw/kdrive/linux/ps2.c
+++ b/hw/kdrive/linux/ps2.c
@@ -25,7 +25,7 @@
#endif
#include <X11/X.h>
#include <X11/Xproto.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include "inputstr.h"
#include "scrnintstr.h"
#include "kdrive.h"
@@ -48,7 +48,7 @@ Ps2ReadBytes(int fd, char *buf, int len, int min)
}
if (tot % min == 0)
break;
- n = poll(&poll_fd, 1, 100);
+ n = xserver_poll(&poll_fd, 1, 100);
if (n <= 0)
break;
}
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index 9a596de75..0093fb512 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -27,7 +27,7 @@
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
@@ -87,7 +87,7 @@ ms_flush_drm_events(ScreenPtr screen)
int r;
do {
- r = poll(&p, 1, 0);
+ r = xserver_poll(&p, 1, 0);
} while (r == -1 && (errno == EINTR || errno == EAGAIN));
/* If there was an error, r will be < 0. Return that. If there was
diff --git a/hw/xfree86/drivers/modesetting/vblank.c b/hw/xfree86/drivers/modesetting/vblank.c
index 07278871f..d5a9ded35 100644
--- a/hw/xfree86/drivers/modesetting/vblank.c
+++ b/hw/xfree86/drivers/modesetting/vblank.c
@@ -32,7 +32,6 @@
#include <unistd.h>
#include <xf86.h>
#include <xf86Crtc.h>
-#include <poll.h>
#include "driver.h"
#include "drmmode_display.h"
diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index d5a70ba3e..6249a625c 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -57,7 +57,7 @@
#endif
#include <X11/X.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
@@ -395,10 +395,10 @@ xf86WaitForInput(int fd, int timeout)
poll_fd.events = POLLIN;
if (fd >= 0) {
- SYSCALL(r = poll(&poll_fd, 1, timeout));
+ SYSCALL(r = xserver_poll(&poll_fd, 1, timeout));
}
else {
- SYSCALL(r = poll(&poll_fd, 0, timeout));
+ SYSCALL(r = xserver_poll(&poll_fd, 0, timeout));
}
xf86ErrorFVerb(9, "poll returned %d\n", r);
return r;
@@ -427,7 +427,7 @@ xf86FlushInput(int fd)
poll_fd.fd = fd;
poll_fd.events = POLLIN;
- while (poll(&poll_fd, 1, 0) > 0) {
+ while (xserver_poll(&poll_fd, 1, 0) > 0) {
if (read(fd, &c, sizeof(c)) < 1)
return 0;
}
diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c
index 949d1b477..884a71c61 100644
--- a/hw/xfree86/os-support/shared/sigio.c
+++ b/hw/xfree86/os-support/shared/sigio.c
@@ -57,7 +57,7 @@
#endif
#include <X11/X.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"
@@ -128,7 +128,7 @@ xf86SIGIO(int sig)
inSignalContext = TRUE;
- SYSCALL(r = poll(xf86SigIOFds, xf86SigIONum, 0));
+ SYSCALL(r = xserver_poll(xf86SigIOFds, xf86SigIONum, 0));
for (f = 0; r > 0 && f < xf86SigIONum; f++) {
if (xf86SigIOFds[f].revents & POLLIN) {
for (i = 0; i < xf86SigIOMax; i++)
diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c
index beb13d2e9..883728e51 100644
--- a/hw/xfree86/os-support/solaris/sun_bell.c
+++ b/hw/xfree86/os-support/solaris/sun_bell.c
@@ -28,7 +28,7 @@
#include <sys/uio.h>
#include <limits.h>
#include <math.h>
-#include <poll.h>
+#include <xserver_poll.h>
#include "xf86.h"
#include "xf86Priv.h"
@@ -163,7 +163,7 @@ xf86OSRingBell(int loudness, int pitch, int duration)
/* sleep a little to allow audio buffer to drain */
naptime = BELL_MS * i;
- poll(NULL, 0, naptime);
+ xserver_poll(NULL, 0, naptime);
i = ((sizeof(samples) * iovcnt) - written) % sizeof(samples);
iovcnt = 0;