os: InputThreadFillPipe doesn't need select or poll
The file descriptors passed to InputThreadFillPipe are always blocking, so there's no need to use Select (or poll). Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
ef7ddbe242
commit
8d3a368d89
|
@ -127,24 +127,10 @@ InputThreadFillPipe(int writeHead)
|
|||
{
|
||||
int ret;
|
||||
char byte = 0;
|
||||
fd_set writePipe;
|
||||
|
||||
FD_ZERO(&writePipe);
|
||||
|
||||
while (1) {
|
||||
do {
|
||||
ret = write(writeHead, &byte, 1);
|
||||
if (!ret)
|
||||
FatalError("input-thread: write() returned 0");
|
||||
if (ret > 0)
|
||||
break;
|
||||
|
||||
if (errno != EAGAIN)
|
||||
FatalError("input-thread: filling pipe");
|
||||
|
||||
DebugF("input-thread: pipe full\n");
|
||||
FD_SET(writeHead, &writePipe);
|
||||
Select(writeHead + 1, NULL, &writePipe, NULL, NULL);
|
||||
}
|
||||
} while (ret < 0 && ETEST(errno));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user