[email protected] wrote, on 28 Jun 2021: > > Stephane Chazelas via austin-group-l at The Open Group dixit: > > >2021-06-28 20:01:03 +0700, Robert Elz: > >[...] > > I see significant support here for my interpretation of this.
I suspect it is a vocal minority, and the vast majority of members of this list would agree that pwd not diagnosing a write error is a bug. For me, it's not even a standards conformance issue. For pwd to exit with status zero when it hasn't written the directory to stdout is so obviously a bug that I can't believe any responsible maintainer would not just go ahead and fix it without giving it more than a moment's thought. > >My Solaris test cases corrected to use EPIPE instead of EBADF: > > > >$ (trap "" PIPE; sleep 1; /usr/xpg4/bin/sh -c 'grep root /etc/passwd; echo > >"$?" >&2') | : > >0 > >$ (trap "" PIPE; sleep 1; /bin/sh -c 'grep root /etc/passwd; echo "$?" >&2') > >| : > >0 > >$ (trap "" PIPE; sleep 1; /bin/sh -c 'pwd; echo "$?" >&2') | : > >0 > > That goes with your statement of… > > >On Solaris 11 (certified as compliant): > > … which makes me think that (besides significant vocal support on > this list) there’s significant precedent for this real-existing, > historically-founded, behaviour of not having to check for all > kinds of stdout/stderr write errors for utilities “like that” (I’d > expect text editors, for example, to still show errors of course), > the boundary of “like that” probably being that it’s not in pwd’s > domain to care about or set up its output (merely using stdout), > whereas text editors deal with filenames and open(2) etc. directly. Nobody is arguing that there wasn't a lot of historical behaviour like this. What's surprising is that these ancient bugs (for bugs they most certainly are) have persisted into the modern era. Since it has been pointed out that Solaris also has the bug, and was able to get certified despite it, I looked into why it is not picked up by the VSC test suite. It turns out that IEEE 2003.2 draft 8 had an assertion that covers it, but for some reason it was classified as "extended" - meaning that test suites do not need to test it and can just record an "Untested" result for that assertion, which is exactly what VSC does. Or did - I have now remedied that. -- Geoff Clare <[email protected]> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
