<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Confusing Junk in the results: Last errno: 25, Inappropriate ioctl for device"
href="https://bugs.freedesktop.org/show_bug.cgi?id=110354#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Confusing Junk in the results: Last errno: 25, Inappropriate ioctl for device"
href="https://bugs.freedesktop.org/show_bug.cgi?id=110354">bug 110354</a>
from <span class="vcard"><a class="email" href="mailto:arkadiusz.hiler@intel.com" title="Arek Hiler <arkadiusz.hiler@intel.com>"> <span class="fn">Arek Hiler</span></a>
</span></b>
<pre>diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 266aa832..b235b18c 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -984,8 +984,11 @@ void igt_debug_wait_for_keypress(const char *var)
{
struct termios oldt, newt;
- if (!isatty(STDIN_FILENO))
+ if (!isatty(STDIN_FILENO)) {
+ errno = 0; /* otherwise may be ENOTTY */
return;
+ }
+
if (!igt_interactive_debug)
return;
Found the culprit in this particular case. This would suppress most of the
weird errno logged in kms tests.
The questions is now: do we really want to hunt all similar cases down? A round
of gdb through a couple of tests with 'watch errno' shows that it gets set to
non-zero value about a dozen times every single subtest. Depending when we hit
an assert we may get any of those printed out adding to confusion.
I see 3 options:
1. make sure that errno is reset to 0 by everything that touches it and change
my nickname to Sisyphus
2. get rid of printing errno in igt_assert(), but then lose valuable
information for all those igt_assert(write(...));
3. change igt_assert*(expr,...) macros so that they 'errno = 0;' before
evaluating expr
I think that 3 makes the most sense, then we can quickly go through all the
4000-ish of calls we have to make sure that we don't have any weird 'int ret =
write(); igt_assert(ret);' for those functions where errno matters.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>