Re: [PATCH v2] Ensure standard file descriptors are open on start

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

 



On 8/28/20 6:52 AM, Zack Weinberg wrote:
I think that for 2.70 we should make fd 0 read-only and 1,2
write-only here, and revisit this afterward -- when we're not in a
release freeze we can think about things like turning on set -e mode.

Sounds good.

In the longer term I doubt whether set -e is the way to go. I recall some old shells mishandling it (e.g., with 'set -e' the command 'A || B' would cause the shell to exit when A failed). And I suspect the use of 'set -e' to detect shell errors is problematic even today. 'set -e' is intended more as a debugging aid than as a programming facility.

One other issue: with some shells 'printf x >/dev/full' succeeds because they buffer output, so you cannot rely on printf exit status telling you that the output actually worked. One can work around this problem by using a utility like 'cat' that doesn't play the game, but of course this has its own issues....




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux