summaryrefslogtreecommitdiff
path: root/vxi11_server.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-24 22:36:21 +0900
committerdaniel <danieruru@gmail.com>2013-01-24 22:36:21 +0900
commit70b0a2a0d5b05230808aa75f594a05109c63f880 (patch)
tree012962359f49b21d8aa448f85091f1a9ef35f662 /vxi11_server.c
parent24ce34333674e918b86727d2b84be79af268ab2e (diff)
make the wait loop simpler
Diffstat (limited to 'vxi11_server.c')
-rw-r--r--vxi11_server.c6
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