Explorar o código

IDEChannel: Fix wait_until_not_busy() (#7084)

The time_elapsed variable would count until milliseconds_timeout + 1,
so a != comparision won't work.
Alexander Richards %!s(int64=4) %!d(string=hai) anos
pai
achega
28a6a9a08f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Kernel/Storage/IDEChannel.cpp

+ 2 - 2
Kernel/Storage/IDEChannel.cpp

@@ -269,7 +269,7 @@ bool IDEChannel::wait_until_not_busy(bool slave, size_t milliseconds_timeout)
         IO::delay(1000);
         time_elapsed++;
     }
-    return time_elapsed != milliseconds_timeout;
+    return time_elapsed <= milliseconds_timeout;
 }
 
 bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
@@ -279,7 +279,7 @@ bool IDEChannel::wait_until_not_busy(size_t milliseconds_timeout)
         IO::delay(1000);
         time_elapsed++;
     }
-    return time_elapsed != milliseconds_timeout;
+    return time_elapsed <= milliseconds_timeout;
 }
 
 String IDEChannel::channel_type_string() const