coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] stty: fix false warnings from [io]speed settings


From: Pádraig Brady
Subject: [PATCH] stty: fix false warnings from [io]speed settings
Date: Sun, 11 Sep 2022 15:47:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Thunderbird/98.0

On 31/08/2022 00:22, Pádraig Brady wrote:
* src/stty.c (apply_settings): Validate [io]speed arguments
against the internal accepted set.
(set_speed): Check the cfset[io]speed() return value so
that we validate against the system supported set.

When testing this I noticed that errors would be
printed on Linux on the first change of [io]speed,
but not on subsequent invocations.

I added the ---debug option to help investigate the
difference between returned and expected mode bits.

That led me to the conclusion that using memcmp()
across the whole mode structure is a layering violation,
which was already seen to fail on Solaris when setting speeds,
and seen to fail on Linux also.

Instead the attached patch uses documented interfaces
(already used anyway in stty), to inspect the returned mode.
This also simplifies the code as we don't need to
handle edge cases.

This was independently identified as an issue in
https://bugs.debian.org/1019468

cheers,
Pádraig

Attachment: stty-iospeed-warnings.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]