diff options
| author | 2010-09-30 00:39:32 -0700 | |
|---|---|---|
| committer | 2010-09-30 00:39:32 -0700 | |
| commit | 18fc21daf5cad44d8dcae677cc1802a9fd166eeb (patch) | |
| tree | 8b4447b587daff0b237d965ed349675d0aeae8c5 | |
| parent | 263ab1cd7d53d90ed80a2d87a96f7724ca9768f5 (diff) | |
| parent | 1c2eccfac3c10a0ec8f3ffc5e22b9294da0a9b67 (diff) | |
Merge "KeyStore: Fix the return value when send() or recv() has an error." into gingerbread
| -rw-r--r-- | cmds/keystore/keystore_get.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/keystore/keystore_get.h b/cmds/keystore/keystore_get.h index 141f69bd53..4b4923e5c7 100644 --- a/cmds/keystore/keystore_get.h +++ b/cmds/keystore/keystore_get.h @@ -32,7 +32,7 @@ extern "C" { #endif /* This function is provided for native components to get values from keystore. - * Users are required to link against libcutils. Keys are values are 8-bit safe. + * Users are required to link against libcutils. Keys and values are 8-bit safe. * The first two arguments are the key and its length. The third argument * specifies the buffer to store the retrieved value, which must be an array of * KEYSTORE_MESSAGE_SIZE bytes. This function returns the length of the value or @@ -65,7 +65,10 @@ static int keystore_get(const char *key, int length, char *value) } offset += n; } + } else { + length = -1; } + close(sock); return length; } |