From 70b0a2a0d5b05230808aa75f594a05109c63f880 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 24 Jan 2013 22:36:21 +0900 Subject: make the wait loop simpler --- vxi11_server.c | 6 ++---- 1 file 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 -- cgit