summaryrefslogtreecommitdiff
path: root/lib/igt_aux.c
diff options
context:
space:
mode:
authorThomas Wood <thomas.wood@intel.com>2015-09-10 11:40:43 +0100
committerThomas Wood <thomas.wood@intel.com>2015-09-11 14:39:43 +0100
commit2bacd07eb3be30fd30ed4fa4645901683b1c6b09 (patch)
tree0794bf3142ff9dbe937452166822a678f4174a38 /lib/igt_aux.c
parentbcd3e1f33f136399659c7b1549be3bae467abaf4 (diff)
lib: don't use igt_warn in signal handlers
igt_wan and other log functions are not async-signal safe, so should not be used in signal handlers. Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r--lib/igt_aux.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index e77392cd..04ca25b0 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -47,6 +47,7 @@
#include <sys/syscall.h>
#include <sys/utsname.h>
#include <termios.h>
+#include <assert.h>
#include "drmtest.h"
#include "i915_drm.h"
@@ -769,9 +770,13 @@ static void igt_module_param_exit_handler(int sig)
if (fd >= 0) {
int size = strlen (data->original_value);
- if (size != write(fd, data->original_value, size))
- igt_warn("%s may not have been reset to its"
- " original value\n", file_path);
+ if (size != write(fd, data->original_value, size)) {
+ const char msg[] = "WARNING: Module parameters "
+ "may not have been reset to their "
+ "original values\n";
+ assert(write(STDERR_FILENO, msg, sizeof(msg))
+ == sizeof(msg));
+ }
close(fd);
}