i965: perf: ensure reading config IDs from sysfs isn't interrupted

Fixes: 458468c136 "i965: Expose OA counters via INTEL_performance_query"
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
(cherry picked from commit bd9672695b)
This commit is contained in:
Lionel Landwerlin 2018-02-07 10:48:32 +00:00 committed by Juan A. Suarez Romero
parent c6849c9314
commit c49dde7f43

View file

@ -1718,7 +1718,8 @@ read_file_uint64(const char *file, uint64_t *val)
fd = open(file, 0);
if (fd < 0)
return false;
n = read(fd, buf, sizeof (buf) - 1);
while ((n = read(fd, buf, sizeof (buf) - 1)) < 0 &&
errno == EINTR);
close(fd);
if (n < 0)
return false;