mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 05:14:46 -04:00
work around a bug in Solaris by using pwrite instead of write; reported by
michael.wookey at citrix.com.au svn:r118
This commit is contained in:
parent
60216e8b1d
commit
6d4bafd03c
@ -278,7 +278,11 @@ devpoll_add(void *arg, struct event *ev)
|
||||
dpev.fd = fd;
|
||||
dpev.events = events;
|
||||
dpev.revents = 0;
|
||||
if (write(devpollop->dpfd, &dpev, sizeof(dpev)) == -1)
|
||||
/*
|
||||
* Due to a bug in Solaris, we have to use pwrite with an offset of 0.
|
||||
* Write is limited to 2GB of data, until it will fail.
|
||||
*/
|
||||
if (pwrite(devpollop->dpfd, &dpev, sizeof(dpev), 0) == -1)
|
||||
return (-1);
|
||||
|
||||
/* Update events responsible */
|
||||
@ -327,7 +331,7 @@ devpoll_del(void *arg, struct event *ev)
|
||||
dpev.events = events | POLLREMOVE;
|
||||
dpev.revents = 0;
|
||||
|
||||
if (write(devpollop->dpfd, &dpev, sizeof(dpev)) == -1)
|
||||
if (pwrite(devpollop->dpfd, &dpev, sizeof(dpev), 0) == -1)
|
||||
return (-1);
|
||||
|
||||
if (needreaddelete)
|
||||
|
Loading…
x
Reference in New Issue
Block a user