Skip to content

stty: print the speed on big-endian PowerPC BSDs - #14668

Merged
sylvestre merged 1 commit into
uutils:mainfrom
pkubaj:big-endian-fix
Sep 18, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
pkubaj:big-endian-fix

Conversation

@pkubaj

@pkubaj pkubaj commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

The baud rate is printed by one of three cfg-gated branches. The first
one is for "BSDs and Linux (not ppc/big-endian ppc64)", but its PowerPC
exclusion was a second #[cfg] stacked on top of
any(target_os = "linux", bsd), so it applied to the BSDs as well. The
second branch is Linux-only and the third covers everything that is
neither Linux nor a BSD. On FreeBSD/powerpc64 (big-endian) and
FreeBSD/powerpc none of the three was compiled in, and stty silently
left "speed N baud;" out of its output.

The PowerPC special case is only needed on Linux, where those targets
get a BaudRate enum instead of a number. On the BSDs the baud rate is a
plain u32 on every architecture, which string_to_baud() already relies
on with a bare #[cfg(bsd)]. Restrict the architecture exclusion to
Linux so that the BSDs always take the u32 path.

Fixes test_stty::test_basic and test_stty::test_stty_uses_stdin on
FreeBSD/powerpc64.

The baud rate is printed by one of three cfg-gated branches. The first
one is for "BSDs and Linux (not ppc/big-endian ppc64)", but its PowerPC
exclusion was a second #[cfg] stacked on top of
any(target_os = "linux", bsd), so it applied to the BSDs as well. The
second branch is Linux-only and the third covers everything that is
neither Linux nor a BSD. On FreeBSD/powerpc64 (big-endian) and
FreeBSD/powerpc none of the three was compiled in, and stty silently
left "speed N baud;" out of its output.

The PowerPC special case is only needed on Linux, where those targets
get a BaudRate enum instead of a number. On the BSDs the baud rate is a
plain u32 on every architecture, which string_to_baud() already relies
on with a bare #[cfg(bsd)]. Restrict the architecture exclusion to
Linux so that the BSDs always take the u32 path.

Fixes test_stty::test_basic and test_stty::test_stty_uses_stdin on
FreeBSD/powerpc64.
@sylvestre

Copy link
Copy Markdown
Contributor

Please split that into two pr

@pkubaj pkubaj changed the title Big endian fixes stty: print the speed on big-endian PowerPC BSDs Sep 18, 2026
@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/retry (passes in this run but fails in the 'main' branch)

@sylvestre
sylvestre merged commit 087286e into uutils:main Sep 18, 2026
101 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants