diff options
author | Eric Engestrom <[email protected]> | 2019-05-01 11:44:16 +0100 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2019-05-16 17:20:13 +0000 |
commit | 7fa89fd959a2557fe8430e15ef21e978d7d3692d (patch) | |
tree | 577c97c35dcd6c06f858ec0a6243ebd24544fa0b /src/gallium/drivers/radeonsi/si_buffer.c | |
parent | 5fcfcdb1627dc8694c3096e825dc57fad36fc2fc (diff) |
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: 316964709e21286c2af5 "util: add os_read_file() helper"
Reported-by: Jason Ekstrand <[email protected]>
Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
(cherry picked from commit 22c1657d0552be0c558ca805c8d574e92f53c2cc)
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_buffer.c')
0 files changed, 0 insertions, 0 deletions