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>
This commit is contained in:
parent
711c36558f
commit
d403aca70a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include <unistd.h>
|
||||
#include <xf86.h>
|
||||
#include <xf86Crtc.h>
|
||||
#include <poll.h>
|
||||
#include "driver.h"
|
||||
#include "drmmode_display.h"
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user