From a558c2e2405473f4157ca71638e5a111ebfa80d1 Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Tue, 9 Apr 2019 17:21:41 +0300 Subject: lib: Reset errno to 0 after isatty Since igt_assert family of functions logs last errno we get a lot of those: "Last errno: 25, Inappropriate ioctl for device" isatty() seems to be the biggest offender in that area, so this patch should limit amount of confusing messages significantly. Cc: Martin Peres Cc: Petri Latvala Signed-off-by: Arkadiusz Hiler Reviewed-by: Petri Latvala --- lib/igt_core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_core.c') diff --git a/lib/igt_core.c b/lib/igt_core.c index 6eb4798e..ae03e909 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -630,6 +630,8 @@ static void common_init_env(void) if (!isatty(STDOUT_FILENO) || getenv("IGT_PLAIN_OUTPUT")) __igt_plain_output = true; + errno = 0; /* otherwise may be either ENOTTY or EBADF because of isatty */ + if (!__igt_plain_output) setlocale(LC_ALL, ""); -- cgit v1.2.3