bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#8846: coreutils-8.12 on HP-UX 11.31: 3 of 365 tests failed


From: Stefano Lattarini
Subject: Re: bug#8846: coreutils-8.12 on HP-UX 11.31: 3 of 365 tests failed
Date: Tue, 14 Jun 2011 00:24:52 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Monday 13 June 2011, Eric Blake wrote:
>
> Not possible to portably sniff out closed fds; quoting the autoconf manual:
> 
> > Don't rely on duplicating a closed file descriptor to cause an
> > error.  With Solaris @command{/bin/sh}, when the redirection fails, the
> > output goes to the original file descriptor.
> 
Do the shells with the close-on-exec issue also suffer of the issue with
closed fds you've reported?  If not, the following could be enough to
solve our situation without having to change automake:

  if (exec 3>&-; exec 4>&3) >/dev/null 2>&1; then
    # Cannot determine whether a file descriptor is closed, fall back
    # to inferior hack.
    if test 2 -ne "$stderr_fileno_" && test ! -t "$stderr_fileno_"; then
      eval "exec $stderr_fileno_>&2" # Or is `stderr_fileno_=2' enough?
    fi
  else
    if (exec 3>&9) >/dev/null 2>&1; then
      :
    else
      eval "exec $stderr_fileno_>&2" # Or is `stderr_fileno_=2' enough?
    fi
  fi

Regards,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]