[PATCH] src/sysdep.h: fix build failure when BOTHER is not found

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Feb 24 09:58:59 GMT 2026


This patch doesn't work as expected, it ends up in struct termios 
redefinition. Need another workaround.

Sorry for the noise

Best regards
Giulio

On 2/24/26 10:33, Giulio Benetti wrote:
> Only including termios.h is not sufficient to gain access to BOTHER macro,
> so let's check if it's defined, and if not include <asm/termbits.h>.
> While doing this let's optimize #ifdef statement.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> ---
>   src/sysdep.h | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/src/sysdep.h b/src/sysdep.h
> index 9ba8836..bf5ed13 100644
> --- a/src/sysdep.h
> +++ b/src/sysdep.h
> @@ -34,16 +34,15 @@
>   #ifdef _SCO
>   #  define _IBCS2 /* So we get struct winsize :-) */
>   #endif
> -#ifdef POSIX_TERMIOS
> +#if defined(POSIX_TERMIOS) || defined(HAVE_TERMIO_H)
>   #  include <termios.h>
> +#  ifndef BOTHER
> +#    include <asm/termbits.h>
> +#  endif
>   #else
> -#  ifdef HAVE_TERMIO_H
> -#    include <termios.h>
> -#  else
> -#    define _V7
> -#    ifdef HAVE_SGTTY_H
> -#      include <sgtty.h>
> -#    endif
> +#  define _V7
> +#  ifdef HAVE_SGTTY_H
> +#    include <sgtty.h>
>   #  endif
>   #endif
>   #ifdef HAVE_SYS_IOCTL_H




More information about the minicom-devel mailing list