lib: Try harder to drop-caches

If at first we don't succeed, try again. (For as long as the errno says
to at least!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-09-12 11:09:41 +01:00
parent f81d8eba4f
commit 4779655c6f

View File

@ -553,7 +553,9 @@ void igt_drop_caches_set(uint64_t val)
fd = igt_debugfs_open("i915_gem_drop_caches", O_WRONLY);
igt_assert(fd >= 0);
do {
nbytes = write(fd, data, strlen(data) + 1);
} while (nbytes == -1 && (errno == EINTR || errno == EAGAIN));
igt_assert(nbytes == strlen(data) + 1);
close(fd);
}