* [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty
@ 2019-04-09 14:21 Arkadiusz Hiler
2019-04-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arkadiusz Hiler @ 2019-04-09 14:21 UTC (permalink / raw)
To: igt-dev; +Cc: Petri Latvala
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 <martin.peres@linux.intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
lib/igt_aux.c | 12 +++++++++---
lib/igt_core.c | 2 ++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 266aa832..a3c904d7 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -631,8 +631,10 @@ static void igt_interactive_info(const char *format, ...)
{
va_list args;
- if (!isatty(STDERR_FILENO) || __igt_plain_output)
+ if (!isatty(STDERR_FILENO) || __igt_plain_output) {
+ errno = 0; /* otherwise would be either ENOTTY or EBADF */
return;
+ }
if (igt_log_level > IGT_LOG_INFO)
return;
@@ -984,8 +986,10 @@ void igt_debug_wait_for_keypress(const char *var)
{
struct termios oldt, newt;
- if (!isatty(STDIN_FILENO))
+ if (!isatty(STDIN_FILENO)) {
+ errno = 0; /* otherwise would be either ENOTTY or EBADF */
return;
+ }
if (!igt_interactive_debug)
return;
@@ -1030,8 +1034,10 @@ void igt_debug_manual_check(const char *var, const char *expected)
struct termios oldt, newt;
char key;
- if (!isatty(STDIN_FILENO))
+ if (!isatty(STDIN_FILENO)) {
+ errno = 0; /* otherwise would be either ENOTTY or EBADF */
return;
+ }
if (!igt_interactive_debug)
return;
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, "");
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for lib: Reset errno to 0 after isatty
2019-04-09 14:21 [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty Arkadiusz Hiler
@ 2019-04-09 15:52 ` Patchwork
2019-04-10 1:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-10 9:55 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2019-04-09 15:52 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
== Series Details ==
Series: lib: Reset errno to 0 after isatty
URL : https://patchwork.freedesktop.org/series/59231/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5897 -> IGTPW_2831
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/59231/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2831 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@sync-fork-compute0:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109315] +17
* igt@gem_exec_basic@gtt-bsd1:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109276] +7
* igt@gem_exec_parse@basic-rejected:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109289] +1
* igt@gem_exec_store@basic-bsd1:
- fi-kbl-r: NOTRUN -> SKIP [fdo#109271] +41
* igt@i915_selftest@live_contexts:
- fi-icl-u3: NOTRUN -> DMESG-FAIL [fdo#108569]
* igt@i915_selftest@live_execlists:
- fi-apl-guc: PASS -> INCOMPLETE [fdo#103927] / [fdo#109720]
* igt@i915_selftest@live_hangcheck:
- fi-bxt-dsi: PASS -> INCOMPLETE [fdo#103927]
* igt@kms_busy@basic-flip-a:
- fi-bsw-n3050: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1
* igt@kms_busy@basic-flip-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
- fi-byt-j1900: NOTRUN -> SKIP [fdo#109271] / [fdo#109278]
* igt@kms_chamelium@hdmi-crc-fast:
- fi-bsw-n3050: NOTRUN -> SKIP [fdo#109271] +62
- fi-byt-j1900: NOTRUN -> SKIP [fdo#109271] +52
* igt@kms_chamelium@hdmi-edid-read:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109284] +8
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-icl-u3: NOTRUN -> SKIP [fdo#109285] +3
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u3: NOTRUN -> FAIL [fdo#103167]
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- fi-blb-e6850: NOTRUN -> SKIP [fdo#109271] +48
* igt@runner@aborted:
- fi-glk-dsi: NOTRUN -> FAIL [k.org#202321]
- fi-apl-guc: NOTRUN -> FAIL [fdo#108622] / [fdo#109720]
#### Possible fixes ####
* igt@gem_ctx_exec@basic:
- fi-icl-u3: INCOMPLETE [fdo#107713] -> PASS
* igt@gem_exec_suspend@basic-s4-devices:
- fi-blb-e6850: INCOMPLETE [fdo#107718] -> PASS
* igt@i915_selftest@live_contexts:
- fi-bdw-gvtdvm: DMESG-FAIL [fdo#110235 ] -> PASS
- fi-skl-gvtdvm: DMESG-FAIL [fdo#110235 ] -> PASS
#### Warnings ####
* igt@i915_pm_rpm@module-reload:
- fi-glk-dsi: INCOMPLETE [fdo#103359] / [k.org#198133] -> DMESG-FAIL [fdo#105538] / [fdo#107732] / [fdo#109513]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105538]: https://bugs.freedesktop.org/show_bug.cgi?id=105538
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107732]: https://bugs.freedesktop.org/show_bug.cgi?id=107732
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108622]: https://bugs.freedesktop.org/show_bug.cgi?id=108622
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109513]: https://bugs.freedesktop.org/show_bug.cgi?id=109513
[fdo#109720]: https://bugs.freedesktop.org/show_bug.cgi?id=109720
[fdo#110235 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110235
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
[k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321
Participating hosts (44 -> 44)
------------------------------
Additional (3): fi-byt-j1900 fi-kbl-r fi-bsw-n3050
Missing (3): fi-byt-squawks fi-bsw-cyan fi-bdw-samus
Build changes
-------------
* IGT: IGT_4934 -> IGTPW_2831
CI_DRM_5897: 7d07e025e78603d6270bc115fdb6c1efea6e66a5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2831: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2831/
IGT_4934: dc4f45eb6874331daec870dc1e4cfc3ac5c49311 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2831/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* [igt-dev] ✓ Fi.CI.IGT: success for lib: Reset errno to 0 after isatty
2019-04-09 14:21 [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty Arkadiusz Hiler
2019-04-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-04-10 1:49 ` Patchwork
2019-04-10 9:55 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2019-04-10 1:49 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
== Series Details ==
Series: lib: Reset errno to 0 after isatty
URL : https://patchwork.freedesktop.org/series/59231/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5897_full -> IGTPW_2831_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/59231/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_2831_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_mmap_gtt@hang:
- shard-iclb: PASS -> FAIL [fdo#109677]
* igt@gem_mocs_settings@mocs-rc6-ctx-dirty-render:
- shard-glk: NOTRUN -> SKIP [fdo#109271] +27
* igt@gem_stolen@stolen-clear:
- shard-iclb: NOTRUN -> SKIP [fdo#109277] +1
* igt@gem_workarounds@suspend-resume:
- shard-iclb: PASS -> FAIL [fdo#103375]
* igt@i915_pm_rpm@i2c:
- shard-iclb: PASS -> DMESG-WARN [fdo#109982]
* igt@kms_atomic_transition@6x-modeset-transitions:
- shard-iclb: NOTRUN -> SKIP [fdo#109278] +1
* igt@kms_busy@extended-modeset-hang-oldfb-render-e:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +1
* igt@kms_chamelium@vga-edid-read:
- shard-iclb: NOTRUN -> SKIP [fdo#109284]
* igt@kms_content_protection@atomic:
- shard-iclb: NOTRUN -> SKIP [fdo#109300]
* igt@kms_content_protection@atomic-dpms:
- shard-apl: NOTRUN -> FAIL [fdo#110321] / [fdo#110336] +1
* igt@kms_crtc_background_color:
- shard-iclb: NOTRUN -> SKIP [fdo#109305]
* igt@kms_cursor_crc@cursor-64x64-onscreen:
- shard-glk: NOTRUN -> FAIL [fdo#103232] +2
* igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
- shard-iclb: PASS -> FAIL [fdo#103355] +2
* igt@kms_flip@2x-flip-vs-absolute-wf_vblank-interruptible:
- shard-iclb: NOTRUN -> SKIP [fdo#109274] +2
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
- shard-iclb: PASS -> FAIL [fdo#103167] +1
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt:
- shard-kbl: NOTRUN -> SKIP [fdo#109271] +14
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-pwrite:
- shard-iclb: PASS -> FAIL [fdo#109247] +4
* igt@kms_frontbuffer_tracking@fbcpsr-rgb101010-draw-blt:
- shard-iclb: PASS -> FAIL [fdo#105682] / [fdo#109247]
* igt@kms_frontbuffer_tracking@psr-2p-primscrn-shrfb-plflip-blt:
- shard-iclb: NOTRUN -> SKIP [fdo#109280] +3
* igt@kms_lease@atomic_implicit_crtc:
- shard-apl: NOTRUN -> FAIL [fdo#110279]
* igt@kms_lease@setcrtc_implicit_plane:
- shard-apl: NOTRUN -> FAIL [fdo#110281]
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-e:
- shard-apl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +21
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-f:
- shard-glk: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2
* igt@kms_plane@pixel-format-pipe-a-planes-source-clamping:
- shard-glk: PASS -> SKIP [fdo#109271]
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-kbl: PASS -> DMESG-WARN [fdo#108566] +1
* igt@kms_plane_alpha_blend@pipe-b-alpha-basic:
- shard-apl: NOTRUN -> FAIL [fdo#108145] +5
* igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
- shard-iclb: PASS -> INCOMPLETE [fdo#110041]
- shard-glk: PASS -> SKIP [fdo#109271] / [fdo#109278] +1
* igt@kms_psr@cursor_mmap_gtt:
- shard-iclb: PASS -> FAIL [fdo#107383] / [fdo#110215]
* igt@kms_psr@psr2_cursor_render:
- shard-iclb: PASS -> SKIP [fdo#109441] +1
* igt@kms_rotation_crc@primary-rotation-180:
- shard-kbl: PASS -> DMESG-WARN [fdo#103558] / [fdo#105602] +14
* igt@kms_setmode@basic:
- shard-kbl: PASS -> FAIL [fdo#99912]
* igt@kms_tv_load_detect@load-detect:
- shard-iclb: NOTRUN -> SKIP [fdo#109309]
* igt@kms_vblank@pipe-a-ts-continuation-suspend:
- shard-iclb: PASS -> FAIL [fdo#104894]
* igt@perf_pmu@busy-accuracy-50-vcs1:
- shard-iclb: NOTRUN -> SKIP [fdo#109276] +7
* igt@prime_vgem@sync-bsd1:
- shard-apl: NOTRUN -> SKIP [fdo#109271] +247
#### Possible fixes ####
* igt@gem_ppgtt@blt-vs-render-ctxn:
- shard-iclb: INCOMPLETE [fdo#109801] -> PASS
* igt@gem_softpin@noreloc-s3:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
* igt@i915_pm_rpm@system-suspend-execbuf:
- shard-glk: DMESG-WARN [fdo#109513] -> PASS
* igt@i915_selftest@live_workarounds:
- shard-iclb: DMESG-FAIL [fdo#108954] -> PASS
* igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
- shard-kbl: FAIL [fdo#109660] -> PASS
* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-kbl: DMESG-WARN [fdo#108566] -> PASS
* igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
- shard-iclb: FAIL [fdo#103355] -> PASS +1
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: FAIL [fdo#102887] -> PASS
* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: FAIL [fdo#102887] / [fdo#105363] -> PASS
* igt@kms_flip@flip-vs-rmfb:
- shard-iclb: INCOMPLETE [fdo#107713] -> PASS
* igt@kms_flip@flip-vs-suspend:
- shard-iclb: FAIL [fdo#103375] -> PASS
* igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
- shard-iclb: FAIL [fdo#103167] -> PASS +1
* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-blt:
- shard-iclb: FAIL [fdo#109247] -> PASS +19
* igt@kms_psr@cursor_plane_onoff:
- shard-iclb: FAIL [fdo#107383] / [fdo#110215] -> PASS
* igt@kms_psr@no_drrs:
- shard-iclb: FAIL [fdo#108341] -> PASS
* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: SKIP [fdo#109441] -> PASS +2
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: FAIL [fdo#109016] -> PASS
* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-kbl: FAIL [fdo#104894] -> PASS
* igt@perf_pmu@rc6-runtime-pm-long:
- shard-iclb: FAIL [fdo#105010] -> PASS
#### Warnings ####
* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: FAIL [fdo#109016] -> INCOMPLETE [fdo#103665]
* igt@runner@aborted:
- shard-glk: ( 2 FAIL ) [fdo#109373] / [k.org#202321] -> FAIL [fdo#109373] / [k.org#202321]
[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103355]: https://bugs.freedesktop.org/show_bug.cgi?id=103355
[fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
[fdo#103558]: https://bugs.freedesktop.org/show_bug.cgi?id=103558
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105010]: https://bugs.freedesktop.org/show_bug.cgi?id=105010
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105602]: https://bugs.freedesktop.org/show_bug.cgi?id=105602
[fdo#105682]: https://bugs.freedesktop.org/show_bug.cgi?id=105682
[fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108954]: https://bugs.freedesktop.org/show_bug.cgi?id=108954
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109277]: https://bugs.freedesktop.org/show_bug.cgi?id=109277
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109284]: https://bugs.freedesktop.org/show_bug.cgi?id=109284
[fdo#109300]: https://bugs.freedesktop.org/show_bug.cgi?id=109300
[fdo#109305]: https://bugs.freedesktop.org/show_bug.cgi?id=109305
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109373]: https://bugs.freedesktop.org/show_bug.cgi?id=109373
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109513]: https://bugs.freedesktop.org/show_bug.cgi?id=109513
[fdo#109660]: https://bugs.freedesktop.org/show_bug.cgi?id=109660
[fdo#109677]: https://bugs.freedesktop.org/show_bug.cgi?id=109677
[fdo#109801]: https://bugs.freedesktop.org/show_bug.cgi?id=109801
[fdo#109982]: https://bugs.freedesktop.org/show_bug.cgi?id=109982
[fdo#110041]: https://bugs.freedesktop.org/show_bug.cgi?id=110041
[fdo#110215]: https://bugs.freedesktop.org/show_bug.cgi?id=110215
[fdo#110279]: https://bugs.freedesktop.org/show_bug.cgi?id=110279
[fdo#110281]: https://bugs.freedesktop.org/show_bug.cgi?id=110281
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
[k.org#202321]: https://bugzilla.kernel.org/show_bug.cgi?id=202321
Participating hosts (10 -> 6)
------------------------------
Missing (4): pig-skl-6260u shard-skl pig-hsw-4770r pig-glk-j5005
Build changes
-------------
* IGT: IGT_4934 -> IGTPW_2831
* Piglit: piglit_4509 -> None
CI_DRM_5897: 7d07e025e78603d6270bc115fdb6c1efea6e66a5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_2831: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2831/
IGT_4934: dc4f45eb6874331daec870dc1e4cfc3ac5c49311 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2831/
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty
2019-04-09 14:21 [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty Arkadiusz Hiler
2019-04-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-10 1:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
@ 2019-04-10 9:55 ` Petri Latvala
2 siblings, 0 replies; 4+ messages in thread
From: Petri Latvala @ 2019-04-10 9:55 UTC (permalink / raw)
To: Arkadiusz Hiler; +Cc: igt-dev
On Tue, Apr 09, 2019 at 05:21:41PM +0300, Arkadiusz Hiler wrote:
> 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 <martin.peres@linux.intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> ---
> lib/igt_aux.c | 12 +++++++++---
> lib/igt_core.c | 2 ++
> 2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 266aa832..a3c904d7 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -631,8 +631,10 @@ static void igt_interactive_info(const char *format, ...)
> {
> va_list args;
>
> - if (!isatty(STDERR_FILENO) || __igt_plain_output)
> + if (!isatty(STDERR_FILENO) || __igt_plain_output) {
> + errno = 0; /* otherwise would be either ENOTTY or EBADF */
> return;
> + }
>
> if (igt_log_level > IGT_LOG_INFO)
> return;
> @@ -984,8 +986,10 @@ void igt_debug_wait_for_keypress(const char *var)
> {
> struct termios oldt, newt;
>
> - if (!isatty(STDIN_FILENO))
> + if (!isatty(STDIN_FILENO)) {
> + errno = 0; /* otherwise would be either ENOTTY or EBADF */
> return;
> + }
>
> if (!igt_interactive_debug)
> return;
> @@ -1030,8 +1034,10 @@ void igt_debug_manual_check(const char *var, const char *expected)
> struct termios oldt, newt;
> char key;
>
> - if (!isatty(STDIN_FILENO))
> + if (!isatty(STDIN_FILENO)) {
> + errno = 0; /* otherwise would be either ENOTTY or EBADF */
> return;
> + }
>
> if (!igt_interactive_debug)
> return;
> 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, "");
>
> --
> 2.20.1
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-10 9:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-09 14:21 [igt-dev] [PATCH i-g-t] lib: Reset errno to 0 after isatty Arkadiusz Hiler
2019-04-09 15:52 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-04-10 1:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-04-10 9:55 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox