summaryrefslogtreecommitdiff
path: root/annotations/generate_annotated_java_files.py
diff options
context:
space:
mode:
authorNikita Iashchenko <nikitai@google.com>2018-10-05 15:58:47 +0100
committerNikita Iashchenko <nikitai@google.com>2018-10-15 15:32:51 +0100
commit60d016756688ffdc0cd8c8fbb15614e3b2d72901 (patch)
treeb29e2934f674aab751cb33bedc6f2dda36e79d1f /annotations/generate_annotated_java_files.py
parent45ff2c2e7f95c57256f0c64915190feadde96a78 (diff)
UnixProcess: Improve error message for generic/unknown error codes.
Replace strcmp with strstr to return a more understandable error message. Using strcmp is wrong, because if errnum is not known, strerror will return 'Unknown error XXX' including errnum, so strict comparison against 'Unknown error' does not work. Searching for a substring with strstr fixes this issue. It is hard to trigger incorrect behavior from java code because it only happens for error codes that are not already handled in errno.h; bug 117755069 tracks the follow-up work of handling remaining error code. Bug: 110019823 Test: cts-tradefed run cts -m CtsLibcoreTestCases --abi arm64-v8a Test: Manually set errnum variable to value 135, which is not defined anywhere in errno.h to confirm the error message equals to expected. Change-Id: I740d32623606dd8c50929f82564219f7bcfa046b
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions