diff options
-rw-r--r-- | vxi11_server.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/vxi11_server.c b/vxi11_server.c index 6f8c487..8a356be 100644 --- a/vxi11_server.c +++ b/vxi11_server.c @@ -73,14 +73,12 @@ static bool waitForLock(Device_Flags flags, long timeout) { } static bool waitforio(long timeout) { - if (!globals.VxiLocks.command_in_progress) - return true; - while (timeout < 0) { + do { if (!globals.VxiLocks.command_in_progress) return true; usleep(250); timeout -= 250; - } + } while (timeout < 0); #ifdef DEBUG printf("timeout waiting for command to finish\n"); #endif |