bash: Fix errstr
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 1 Oct 2018 01:27:12 +0000 (21:27 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 2 Oct 2018 18:07:01 +0000 (14:07 -0400)
commit58cfde0519f1f7905491a2b9107d6c32aec7e008
tree0a58afe5f6f0340ab528c67cf42f160719ae7644
parentd4450dffe5905d832748ae6f10f7d2b76f211047
bash: Fix errstr

The old stuff wasn't working, at least not for echo, which calls bash's
internal error function (builtin_error).  It looks like that
USE_AKAROS_STRERROR wasn't defined.

Now we just tack on errstr after printing the error message and
strerror.  It's not perfect, since the IO stream isn't locked, but it's
good enough.  Additionally, there's a change we're printing an old
errstr, same as with other apps.

Regardless, bash's now reports error strings:

$ echo garbage > /prof/mpstat
bash: echo: write error: Generic Failure, Bad mpstat option (reset|ipi|on|off)

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tools/sys-apps/bash/akaros-patches/4.3.30/0004-errstr-patch