Browse Source

HADOOP-3640. Fix the read method in the NativeS3InputStream. Contributed by
Tom White.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@672862 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 17 năm trước cách đây
mục cha
commit
b3c86c6dd8

+ 3 - 0
CHANGES.txt

@@ -53,6 +53,9 @@ Trunk (unreleased changes)
     HADOOP-3563.  Refactor the distributed upgrade code so that it is 
     easier to identify datanode and namenode related code. (dhruba)
 
+    HADOOP-3640. Fix the read method in the NativeS3InputStream. (tomwhite via
+    omalley)
+
 Release 0.18.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 2 - 2
src/core/org/apache/hadoop/fs/s3native/NativeS3FileSystem.java

@@ -87,8 +87,8 @@ public class NativeS3FileSystem extends FileSystem {
     
     public synchronized int read() throws IOException {
       int result = in.read();
-      if (result > 0) {
-        pos += result;
+      if (result != -1) {
+        pos++;
       }
       return result;
     }