Add deadline support to io_output(), io_output_if_queue_long()
Replace parameter wait by deadline. Non-zero wait argument becomes (time_t)-1 argument, zero wait argument becomes zero deadline argument. No functional change, yet.
This commit is contained in:
parent
ddbcce12c3
commit
7a3cbf037a
5 changed files with 38 additions and 24 deletions
|
@ -61,6 +61,7 @@ int
|
|||
recvclient(char *cmd, int size)
|
||||
{
|
||||
int count, res;
|
||||
time_t deadline;
|
||||
|
||||
count = -1;
|
||||
while (!player->aborted) {
|
||||
|
@ -80,8 +81,9 @@ recvclient(char *cmd, int size)
|
|||
* Flush all queued output before potentially sleeping in
|
||||
* io_input(), to make sure player sees the prompt.
|
||||
*/
|
||||
while (io_output(player->iop,
|
||||
player->may_sleep >= PLAYER_SLEEP_ON_INPUT) > 0)
|
||||
deadline = (time_t)(player->may_sleep >= PLAYER_SLEEP_ON_INPUT
|
||||
? -1 : 0);
|
||||
while (io_output(player->iop, deadline) > 0)
|
||||
;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue