Re: the GPG_TTY line in bashrc produces error message in chroot environment

"Jamenson Espindula" ([email protected] via blfs-dev Mailing List) <[email protected]> Mon, 20 Oct 2025 01:24:52 -0300
Newsgroups gmane.linux.lfs.beyond.devel
Message-ID <CAOW_YO=+g6iPz2g=Lgv6i1utQvUvGk9JoQGNLdrC57hLVrfCCw@mail.gmail.com>
Em dom., 19 de out. de 2025 às 23:36, Jamenson Espindula
<[email protected]> escreveu:
>
> I add that I thing it strange. I transcript partially the POSIX
> specification (source:
> <https://pubs.opengroup.org/onlinepubs/9799919799/functions/isatty.html>):
>
>  = = = Transcription begins = = =
>
> NAME
>
>     isatty — test for a terminal device
>
> SYNOPSIS
>
>     #include <unistd.h>
>
>     int isatty(int fildes);
>
> DESCRIPTION
>
>     The isatty() function shall test whether fildes, an open file
> descriptor, is associated with a terminal device.
>
> RETURN VALUE
>
>     The isatty() function shall return 1 if fildes is associated with
> a terminal; otherwise, it shall return 0 and may set errno to indicate
> the error.
>
> ERRORS
>
>     The isatty() function may fail if:
>
>     [EBADF]
>         The fildes argument is not a valid open file descriptor.
>     [ENOTTY]
>         The file associated with the fildes argument is not a terminal.
>
>  = = = Transcription ends = = =
>
> My point is: if 'fildes' effectively is associated with a terminal,
> then should not it return zero '0' indicating that effectively it is a
> TTY?
>
> Jamenson Ferreira Espindula de Almeida Melo
> Jaboatão dos Guararapes, Pernambuco, Brazil
> GNU/Linux user #166197; LFS ID 24492
> Key fingerprint: 234D 1914 4224 7C53 BD13 6855 2AE0 25C0 08A8 6180

Conventionally, 'zero' indicates a return status of success; non-zero
indicates a return status of failure.

Notably, the mentioned POSIX specification seems to suggest a return
status non-conventionally.

Jamenson Ferreira Espindula de Almeida Melo
Jaboatão dos Guararapes, Pernambuco, Brazil
GNU/Linux user #166197; LFS ID 24492
Key fingerprint: 234D 1914 4224 7C53 BD13 6855 2AE0 25C0 08A8 6180

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-dev
Unsubscribe: See the above information page