From 4779655c6f9c8c6c4599fd39cdff1f66d0f373b3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 12 Sep 2014 11:09:41 +0100 Subject: 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 --- lib/igt_debugfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/igt_debugfs.c') diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index 7f04181e..387ffbf6 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -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); - nbytes = write(fd, data, strlen(data) + 1); + do { + nbytes = write(fd, data, strlen(data) + 1); + } while (nbytes == -1 && (errno == EINTR || errno == EAGAIN)); igt_assert(nbytes == strlen(data) + 1); close(fd); } -- cgit v1.2.3