(recvclient): Fix race condition: when io_output_all() blocked, then

got unblocked by command abortion, it could then block in io_input().
This commit is contained in:
Markus Armbruster 2007-01-17 19:13:53 +00:00
parent b2ec71c50e
commit 49941ef169

View file

@ -62,6 +62,8 @@ recvclient(char *cmd, int size)
count = io_gets(player->iop, cmd, size); count = io_gets(player->iop, cmd, size);
while (!player->aborted && count < 0) { while (!player->aborted && count < 0) {
io_output_all(player->iop); io_output_all(player->iop);
if (player->aborted)
return -2;
io_input(player->iop, IO_WAIT); io_input(player->iop, IO_WAIT);
if (io_error(player->iop)) if (io_error(player->iop))
player->aborted++; player->aborted++;