mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-12 10:26:12 +00:00
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>
This commit is contained in:
parent
bcd3e1f33f
commit
2bacd07eb3
@ -47,6 +47,7 @@
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include "drmtest.h"
|
#include "drmtest.h"
|
||||||
#include "i915_drm.h"
|
#include "i915_drm.h"
|
||||||
@ -769,9 +770,13 @@ static void igt_module_param_exit_handler(int sig)
|
|||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
int size = strlen (data->original_value);
|
int size = strlen (data->original_value);
|
||||||
|
|
||||||
if (size != write(fd, data->original_value, size))
|
if (size != write(fd, data->original_value, size)) {
|
||||||
igt_warn("%s may not have been reset to its"
|
const char msg[] = "WARNING: Module parameters "
|
||||||
" original value\n", file_path);
|
"may not have been reset to their "
|
||||||
|
"original values\n";
|
||||||
|
assert(write(STDERR_FILENO, msg, sizeof(msg))
|
||||||
|
== sizeof(msg));
|
||||||
|
}
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user