stty: print the speed on big-endian PowerPC BSDs - #14668
Merged
Merged
Conversation
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.
Contributor
|
Please split that into two pr |
pkubaj
force-pushed
the
big-endian-fix
branch
from
September 18, 2026 11:59
1b9b5eb to
53dcd5c
Compare
|
GNU testsuite comparison: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.