GNU bug report logs - #16940
[PATCH] tests: Do not access /dev/tty if it does not exist

Previous Next

Package: coreutils;

Reported by: Cyril Roelandt <tipecaml <at> gmail.com>

Date: Wed, 5 Mar 2014 03:42:01 UTC

Severity: normal

Tags: fixed, patch

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Cyril Roelandt <tipecaml <at> gmail.com>
Cc: 16940 <at> debbugs.gnu.org
Subject: bug#16940: [PATCH] tests: Do not access /dev/tty if it does not exist
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.




This bug report was last modified 6 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.