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:
Keith Packard 2016-06-01 22:47:29 -07:00 committed by Adam Jackson
parent ef7ddbe242
commit 8d3a368d89

View File

@ -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));
}
/**