am 2cbb56f9: Merge "KeyStore: Fix the return value when send() or recv() has an error." into gingerbread

Merge commit '2cbb56f961e4893a3bf7ded560d4bdbf45eabd01' into gingerbread-plus-aosp

* commit '2cbb56f961e4893a3bf7ded560d4bdbf45eabd01':
  KeyStore: Fix the return value when send() or recv() has an error.
This commit is contained in:
Chia-chi Yeh
2010-09-30 10:10:59 -07:00
committed by Android Git Automerger

View File

@@ -32,7 +32,7 @@ extern "C" {
#endif #endif
/* This function is provided for native components to get values from keystore. /* 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 * 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 * 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 * 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; offset += n;
} }
} else {
length = -1;
} }
close(sock); close(sock);
return length; return length;
} }