mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-26 03:07:24 +00:00
core: Only display the errno message if errno is set
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
This commit is contained in:
parent
b2d1a598ab
commit
4145462250
@ -575,6 +575,10 @@ void __igt_skip_check(const char *file, const int line,
|
|||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
int err = errno;
|
int err = errno;
|
||||||
|
char *err_str = NULL;
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
asprintf(&err_str, "Last errno: %i, %s\n", err, strerror(err));
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
static char *buf;
|
static char *buf;
|
||||||
@ -589,13 +593,13 @@ void __igt_skip_check(const char *file, const int line,
|
|||||||
|
|
||||||
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
|
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
|
||||||
"Test requirement: (%s)\n%s"
|
"Test requirement: (%s)\n%s"
|
||||||
"Last errno: %i, %s\n",
|
"%s",
|
||||||
func, file, line, check, buf, err, strerror(err));
|
func, file, line, check, buf, err_str ?: "");
|
||||||
} else {
|
} else {
|
||||||
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
|
igt_skip("Test requirement not met in function %s, file %s:%i:\n"
|
||||||
"Test requirement: (%s)\n"
|
"Test requirement: (%s)\n"
|
||||||
"Last errno: %i, %s\n",
|
"%s",
|
||||||
func, file, line, check, err, strerror(err));
|
func, file, line, check, err_str ?: "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user