Subject: Re: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist

From: Pádraig Brady <[email-masked]>
Date: Wed, 05 Mar 2014 04:20:04 +0000

On 03/05/2014 03:34 AM, Cyril Roelandt wrote:
> * tests/misc/nohup.sh: Do not try to access /dev/tty if it does not exist. This
>   happens on GNU Guix, for instance.
> ---
>  tests/misc/nohup.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh
> index 6d2b515..e331eab 100755
> --- a/tests/misc/nohup.sh
> +++ b/tests/misc/nohup.sh
> @@ -61,7 +61,7 @@ rm -f nohup.out err
>  
>  # Bug present through coreutils 8.0: failure to print advisory message
>  # to stderr must be fatal.  Requires stdout to be terminal.
> -if test -w /dev/full && test -c /dev/full; then
> +if test -w /dev/full && test -c /dev/full && test -f /dev/tty; then
>  (
>    exec >/dev/tty
>    test -t 1 || exit 0

We might as well ensure it's a writeable char device while we're at it.
I'll apply it in your name in the morning with the following adjustment,
unless you have an objection:

  if test -w /dev/full && test -c /dev/full &&
     test -w /dev/tty && test -c /dev/tty; then

Note this might also handle this Fedora rawhide issue
that I noticed in passing yesterday:
http://pkgs.fedoraproject.org/cgit/coreutils.git/commit/?id=156e6cc

thanks!
Pádraig.