Lock the writer socket across sorwakeup(fip->fi_writesock).

Spotted by:	peter
This commit is contained in:
Seigo Tanimura 2002-05-21 02:37:56 +00:00
parent 743f138e8d
commit 102638407c

View File

@ -224,11 +224,13 @@ fifo_open(ap)
if (fip->fi_writers == 1) {
SOCK_LOCK(fip->fi_readsock);
fip->fi_readsock->so_state &= ~SS_CANTRCVMORE;
SOCK_UNLOCK(fip->fi_readsock);
if (fip->fi_readers > 0) {
wakeup((caddr_t)&fip->fi_readers);
SOCK_LOCK(fip->fi_writesock);
sorwakeup(fip->fi_writesock);
SOCK_UNLOCK(fip->fi_writesock);
}
SOCK_UNLOCK(fip->fi_readsock);
}
}
if ((ap->a_mode & FREAD) && (ap->a_mode & O_NONBLOCK) == 0) {