bug-gnulib
[Top][All Lists]
Advanced

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

Re: purpose of *-safer?


From: Bruno Haible
Subject: Re: purpose of *-safer?
Date: Wed, 26 Jul 2006 15:38:25 +0200
User-agent: KMail/1.9.1

Eric Blake wrote:
> POSIX requires [n]>&- and [n]<&- redirection operators to close
> the respective stream, even when n is 0, 1, or 2.  POSIX allows an
> implementation to supply replacement file descriptors when exec'ing a
> setuid or setgid program.  But in the normal case, implementations really
> do allow you to start life with any of the three standard streams closed.

Thanks for explaining. I wasn't aware that sh has built-in operators
for doing this.

> that doesn't mean GNU programs can't be robust against it.

OK, but what is the correct behaviour? Signal an error?

  $ cp --help >&- ; echo $?
  cp: write error: Bad file descriptor
  1

or treat it like /dev/null?

  $ cp --help >&- ; echo $?
  0

Bruno




reply via email to

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