From: Eric Engestrom Date: Thu, 16 May 2019 13:57:07 +0000 (+0100) Subject: util/os_file: actually return the error read() gave us X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e35f20d44321b20777020ad067d39116d142013;p=mesa.git util/os_file: actually return the error read() gave us Fixes: 316964709e21286c2af5 "util: add os_read_file() helper" Signed-off-by: Eric Engestrom Reviewed-by: Eric Anholt --- diff --git a/src/util/os_file.c b/src/util/os_file.c index 246fd32fdf6..da17d12b50e 100644 --- a/src/util/os_file.c +++ b/src/util/os_file.c @@ -29,8 +29,10 @@ readN(int fd, char *buf, size_t len) if (ret == -EINTR || ret == -EAGAIN) continue; - if (ret <= 0) + if (ret <= 0) { + err = ret; break; + } total += ret; } while (total != len);