[Bug 223516] man(1) ignores the exit status of groff

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Dec 8 09:18:34 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223516

Wolfram Schneider <wosch at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
                 CC|                            |wosch at FreeBSD.org
           Assignee|wosch at FreeBSD.org           |freebsd-bugs at FreeBSD.org

--- Comment #1 from Wolfram Schneider <wosch at FreeBSD.org> ---
I think the problem is in the function

line 456:
   456                  eval "$cattool $manpage | $pipeline"
   457                  ret=$?

we are checking only the status of the last command, which is the $PAGER (e.g.
less(1))

eval '/usr/bin/zcat /home/wosch/man/man7/salt.7.gz | tbl | groff -S -P-h -Wall
-mtty-char -man  -Tascii -P-c | less'

and ignore the exit status of groff (and tbl, zcat - any command in the
pipeline)

The bash has an option to fail on pipe errors

$ set -o pipefail

unfortunately, our /bin/sh implementation does not have this feature.


There are workaround for shell which don’t check the pipe status, as described
in
https://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another

(((((exec 3>&- 4>&-; someprog); echo $? >&3) | filter >&4) 3>&1) | (read xs;
exit $xs)) 4>&1

but this looks bizarre and you have to do it for every command in the pipe
line.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list