igt.cocci: check the return values of various functions

Add rules to fix unused-result warnings when compiling with
_FORTIFY_SOURCE defined and apply them to the library and tests.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
This commit is contained in:
Thomas Wood
2015-03-25 16:42:57 +00:00
parent 0c4dd28d2d
commit 47f6b1305c
11 changed files with 58 additions and 29 deletions
+2 -2
View File
@@ -45,12 +45,12 @@ static void disable_audio_runtime_pm(void)
fd = open("/sys/module/snd_hda_intel/parameters/power_save", O_WRONLY);
if (fd >= 0) {
write(fd, "1\n", 2);
igt_assert_eq(write(fd, "1\n", 2), 2);
close(fd);
}
fd = open("/sys/bus/pci/devices/0000:00:03.0/power/control", O_WRONLY);
if (fd >= 0) {
write(fd, "auto\n", 5);
igt_assert_eq(write(fd, "auto\n", 5), 5);
close(fd);
}
/* Give some time for it to react. */