changeset 121:e68afdf9b782

8075597: [UART] Invalid return value is provided buffer is empty. Summary: Fixed return value calculation Reviewed-by: alkonsta
author snazarki
date Tue, 24 Mar 2015 11:29:20 +0300
parents 29314732135b
children 2d562d9c0044
files src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Mar 24 11:27:34 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Mar 24 11:29:20 2015 +0300
@@ -693,10 +693,10 @@
                         stopReading();
                     }
                 } // if !event thread
+                ret = dst.position() - ret;
             } // if has Remaining
-            ret = dst.position() - ret;
         } // synch handle
-        return ret==0?-1:ret;
+        return ret;
     }
 
     /**