]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
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 0683ddd796f7310228bda060ddb7a2351928a4f0..d3af5eed9f79bfd206d65cc25350ce4d57ebd2d0 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 */