summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-09-12 11:09:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-09-12 11:12:21 +0100
commit4779655c6f9c8c6c4599fd39cdff1f66d0f373b3 (patch)
treeb5d033674e218faf7cec65147fa943afcf8927b1
parentf81d8eba4fb4448e6ea777aa2072c3b9f277e7cb (diff)
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>
-rw-r--r--lib/igt_debugfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 7f04181e6..387ffbf61 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);
}