Merge "Actually terminate on EOF"
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index ee1283c..2612325 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -296,7 +296,7 @@
     size_t remaining = size;
     while (remaining > 0) {
         ssize_t n = TEMP_FAILURE_RETRY(read(fd, data, remaining));
-        if (n < 0) {
+        if (n <= 0) {
             return size - remaining;
         }
         data += n;