Fix fake Android keystore_get() to return -1 on failure
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 17 Jun 2012 01:37:42 +0000 (02:37 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 17 Jun 2012 01:37:51 +0000 (02:37 +0100)
Harmless in this case, but it doesn't hurt to be consistent with Android.
At least, with what Android does when it's *not* buggy... :)

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
openconnect-internal.h

index 0683ddd..d3af5ee 100644 (file)
@@ -412,7 +412,7 @@ static inline int keystore_get(const char *p, int plen, char *content)
        len = read(fd, content, KEYSTORE_MESSAGE_SIZE);
        close(fd);
        if (len <= 0)
-               return 0;
+               return -1;
        return len;
 }
 #endif /* FAKE_ANDROID_KEYSTORE */