Created attachment 185973 [details] Patch to avoid calling oerr if there is no errno set. If stdout becomes a broken pipe while tail(1) is writing to it, then an incorrect error message can be displayed. E.g. $ seq -f '%128g' 1 1000 > /tmp/ints $ tail -n 856 /tmp/ints | awk '{ exit }' tail: stdout: No such file or directory $ The problem is that WR in src/usr.bin/tail/extern.h can call oerr() if write returned a non negative value indicating a partial write, in which case errno is not set. The attached patch fixes the test case.