Skip to content
Commit 7fa89fd9 authored by Eric Engestrom's avatar Eric Engestrom Committed by Juan A. Suarez Romero
Browse files

util/os_file: always use the 'grow' mechanism



Use fstat() only to pre-allocate a big enough buffer.

This fixes a race where if the file grows between fstat() and read()
we would be missing the end of the file, and if the file slims down
read() would just fail.

Fixes: 31696470 "util: add os_read_file() helper"
Reported-by: default avatarJason Ekstrand <jason@jlekstrand.net>
Signed-off-by: default avatarEric Engestrom <eric.engestrom@intel.com>
Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit 22c1657d)
parent 5fcfcdb1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment