summaryrefslogtreecommitdiff
path: root/lib/igt_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_sysfs.c')
-rw-r--r--lib/igt_sysfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index dc178b3d..4fd0d47f 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -63,6 +63,8 @@ static int readN(int fd, char *buf, int len)
return total ?: ret;
total += ret;
+ if (total == len)
+ return total;
} while (1);
}
@@ -78,6 +80,8 @@ static int writeN(int fd, const char *buf, int len)
return total ?: ret;
total += ret;
+ if (total == len)
+ return total;
} while (1);
}