summaryrefslogtreecommitdiff
path: root/libs/androidfw/ObbFile.cpp
diff options
context:
space:
mode:
author Jing Ji <jji@google.com> 2024-07-12 14:52:13 -0700
committer T.J. Mercier <tjmercier@google.com> 2024-07-14 20:26:09 +0000
commit7c5b6d11532b2904c19fccaacd709b79b80b4f20 (patch)
treeb988869c5e0d94961ae676a3c71cf086fdbb5dfb /libs/androidfw/ObbFile.cpp
parent8a83c38bc1fea791b09cd23eb677452dc34f763b (diff)
Keep reading until end-of-file in reading procfs
As the pread(2) says "it is not an error for a successful call to transfer fewer bytes than requested". The only way to verify we're hitting the end-of-file is to keep reading from the file until it returns 0. Here we're following this rule, in order to make sure we read the whole procfs file to avoid the parser errors. The drawback is that, now for every procfs read, it'll have to hit the pread() at least twice. But if it has reached to the end-of-file, the last read should return within microseconds. Bug: 351917521 Flag: EXEMPT bugfix Test: dumpsys cpuinfo Change-Id: If6a14c4e8f4f1821628f1efb984f8064d4969a8c Merged-In: If6a14c4e8f4f1821628f1efb984f8064d4969a8c
Diffstat (limited to 'libs/androidfw/ObbFile.cpp')
0 files changed, 0 insertions, 0 deletions