changeset 125:4ea5718a30d3

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 cbc878a0c120
children dc977f532a4a
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	Mon Mar 23 13:32:55 2015 +0300
+++ b/src/share/classes/com/oracle/dio/uart/impl/UARTImpl.java	Tue Mar 24 11:29:20 2015 +0300
@@ -692,9 +692,9 @@
                         stopReading();
                     }
                 } // if !event thread
+                ret = dst.position() - ret;
             } // if has Remaining
-            ret = dst.position() - ret;
-        return ret==0?-1:ret;
+        return ret;
     }
 
     /**