On Thu, Aug 27, 2020 at 6:49 PM Paul Eggert wrote:
>
> On 8/27/20 3:20 PM, Zack Weinberg wrote:
> > On Thu, Aug 27, 2020 at 2:09 PM Paul Eggert wrote:
> >>
> >>> + if (exec 3>&0) 2>/dev/null; then :; else exec 0 >>> + if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
> >>> + if
On 8/27/20 3:20 PM, Zack Weinberg wrote:
On Thu, Aug 27, 2020 at 2:09 PM Paul Eggert wrote:
+ if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+ if (exec 3>&2); then :; else exec 2>/dev/null; fi
This is all
On Thu, Aug 27, 2020 at 2:09 PM Paul Eggert wrote:
>
> > + if (exec 3>&0) 2>/dev/null; then :; else exec 0 > + if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
> > + if (exec 3>&2); then :; else exec 2>/dev/null; fi
>
> This is all _AS_ENSURE_STANDARD_FDS needs to do;
+ if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+ if (exec 3>&2); then :; else exec 2>/dev/null; fi
This is all _AS_ENSURE_STANDARD_FDS needs to do; none of the other stuff is
needed and I suggest omitting it as a maintenance
A patch was recently proposed for GNU libc to make *all* processes
start up with file descriptors 0, 1, and 2 guaranteed to be open.
Part of the rationale for this patch was that configure scripts fail
catastrophically if these fds are closed, even if you just want to run
--help or --version, e.g.