tools: termios_linux.h: Fix build error on ppc64
authorJavier Martinez Canillas <javierm@redhat.com>
Fri, 27 Jun 2025 13:53:37 +0000 (15:53 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 9 Jul 2025 00:15:20 +0000 (18:15 -0600)
commit6df1b1cd4e38575019c8b4f605c07a784c63f40e
tree6327f30902600bd16cfc79bffe1f4d4f6afd7219
parent61a3e1b043068abc26fa2c72ac4d420c61dc1cd5
tools: termios_linux.h: Fix build error on ppc64

Commit 93b55636b09f ("tools: kwboot: Allow any baudrate on Linux") added a
tcgetattr() function to be used, instead of the libc's termios functions.

This was done to allow using the raw TCGETS2/TCSETS2 ioctls that allow to
support arbitrary baud rates.

This breaks the build for PowerPC, because that architecture does not have
a struct termios2 defined because the termios and ktermios are the same.

On PowerPC, the termios ioctl() emulates the TCGETS2/TCSETS*2 ioctls with
tcgetattr/tcsetattr using just the struct termios (that's as mentioned the
same than what is defined as struct termios2 in other architectures).

So there is no need to use the TCGETS2/TCSETS2 ioctls on that architecture
and just TCGETS/TCSETS ioctls with termios as defined by PowerPC is enough.

Fixes: 93b55636b09f ("tools: kwboot: Allow any baudrate on Linux")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
tools/termios_linux.h