Mesa (staging/19.1): util/os_file: actually return the error read() gave us
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 11 08:27:56 UTC 2019
Module: Mesa
Branch: staging/19.1
Commit: c025240f6c2c2f5e704691acf4a5450a6ae56cc9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c025240f6c2c2f5e704691acf4a5450a6ae56cc9
Author: Eric Engestrom <eric.engestrom at intel.com>
Date: Thu May 16 14:57:07 2019 +0100
util/os_file: actually return the error read() gave us
Fixes: 316964709e21286c2af5 "util: add os_read_file() helper"
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
(cherry picked from commit 7e35f20d44321b20777020ad067d39116d142013)
---
src/util/os_file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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);
More information about the mesa-commit
mailing list