Browse Source

fix Solaris /dev/poll

master
Felix von Leitner 18 years ago
parent
commit
cd4de45382
  1. 1
      io/io_dontwantread.c
  2. 1
      io/io_dontwantwrite.c
  3. 12
      io/io_waituntil2.c

1
io/io_dontwantread.c

@ -47,6 +47,7 @@ void io_dontwantread(int64 d) {
x.fd=d;
x.events=0;
if (e->wantwrite) x.events|=POLLOUT;
if (!x.events) x.events=POLLREMOVE;
write(io_master,&x,sizeof(x));
}
#endif

1
io/io_dontwantwrite.c

@ -47,6 +47,7 @@ void io_dontwantwrite(int64 d) {
x.fd=d;
x.events=0;
if (e->wantread) x.events|=POLLIN;
if (!x.events) x.events=POLLREMOVE;
write(io_master,&x,sizeof(x));
}
#endif

12
io/io_waituntil2.c

@ -103,13 +103,17 @@ int64 io_waituntil2(int64 milliseconds) {
}
if (!e->canread && (y[n].revents&POLLIN)) {
e->canread=1;
e->next_read=first_readable;
first_readable=y[n].fd;
if (e->next_read==-1) {
e->next_read=first_readable;
first_readable=y[n].fd;
}
}
if (!e->canwrite && (y[n].revents&POLLOUT)) {
e->canwrite=1;
e->next_write=first_writeable;
first_writeable=y[i].fd;
if (e->next_write==-1) {
e->next_write=first_writeable;
first_writeable=y[i].fd;
}
}
}
}

Loading…
Cancel
Save