1. Immediately ignore all the signals we want to ignore and set the alarm.
2. Before we exit on error, restore all signals we modified
3. Before we exec a shell, restore all signals we modified and ignore TSTP.
Job control aware shells know how to deal with this.
4. Temporarily handle SIGINT while we read motd.
the expectations of Lst_Find*. This way we only read the first sys.mk
found via sysIncPath.
At the same time we need to add a ReadAllMakefiles() for the case
where multiple -f makefile args are provided (uncommon, but documented).
- avoid double slashes when displaying man pages (got tired
of '/usr/share/man//cat1/man.0').
- got rid of __P() while working on it.
- incorporate some of my old notes explaining how manpath works into the
comments of the code itself.
- renamed some of the vars so that the code is consistent throughout
(and hopefully clearer and easier to understand)
- fixed relative man paths for multiple man pages (man did a chdir()
on the first man page it had to format --- this broke any remaining
relative path man pages left to process). save old directory and
fchdir() back to it after formatting.
- improved doc on "man -h" which does more than just whatis(1) [e.g.
"man -h fopen" prints the required include files and the prototypes
rather than just the one-liner you get with whatis(1)]
- manconf.c now fills in the "len" length field in the TAG/ENTRY
structures (man now uses len).
revise man.conf file reading stuff to return error on failure in
addentry/gettag (fka getlist) rather than just err()ing out. this
allows man(1) to call cleanup and delete its tmp files rather than
just leave them floating. revise other apps using this code
(makewhatis, apropos, catman, whatis) to expect this. also remove
__P on updated files.
In particular avoid calling fclose() again once it has failed.
Also multply 'oreg' by 2 once we modify the file - so we know when to
unlink it on error.
Fixes Coverty CIDs 2535 and 2536
I'm not at all sure EOF handling is correct anyway - but it probably only
affects the last line of a file (and maybe last lines without \n).
In particular I suspect that 'ungetc(EOF, file)' doesn't do the expected
thing, and that fseek() needs to be preceeded by clearerr(). But life it short.
TIPIN and TIPOUT processes with a third "attention" pipe. While we're
here, fix a few other minor nits like the hardcoded use of fd 3 in
consh().
Now ~+/~C appear to work. This must have been broken for years.