summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-09-30 15:17:58 +0800
committerChia-chi Yeh <chiachi@android.com>2010-09-30 15:17:58 +0800
commitc741a2fe41ea33fc386a4d5b932cc081aa92a18c (patch)
tree548221e5a1edea96182ef93869baef1cd7280d10
parent5068ad8d2396d6d7bfbdb1c2c3fe57104744f1f9 (diff)
downloadframeworks_base-c741a2fe41ea33fc386a4d5b932cc081aa92a18c.zip
frameworks_base-c741a2fe41ea33fc386a4d5b932cc081aa92a18c.tar.gz
frameworks_base-c741a2fe41ea33fc386a4d5b932cc081aa92a18c.tar.bz2
KeyStore: Fix the return value when send() or recv() has an error.
Change-Id: I20a63c76bd29b1a9f8959a6c4fe5a5b8a9a971b4
-rw-r--r--cmds/keystore/keystore_get.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/keystore/keystore_get.h b/cmds/keystore/keystore_get.h
index 141f69b..4b4923e 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;
}