freebsd-dev/usr.sbin/vidcontrol
Bruce Evans 2b881cf4c6 Save errno across revert().
Change 25 uses of errc() to err().  2 of these were correct.  23 used
errno for the arg so were just a verbose spelling of err().  5 of these
were just style bugs, and 18 depended on revert() saving errno.

1 warn() also depended on revert() saving errno.

Remove 2 warnx()'s that duplicate the message from a later errx().
These used to be before returns, and should have reported errno in
some cases.  errno is also not reported for for openguess() failures.

Only "restore" the video mode in revert() if the mode was just set
(necessarily partially).  Setting the mode to its current setting
doesn't "restore" it, but resets it, with the least harmful change
being to clear the screen.  revert() is called even for some harmless
syntax errors and usually did nothing except reset the mode.  Now it
usually does nothing.  The only things that it tries to restore apart
from the mode are the active vty number, the screen map, 2 colors that
only need to be restored (only after a mode change) to fix kernel bugs,
and 3 colors that can't be restored due to kernel bugs.  (This is
mostly for sc, since vt doesn't support mode changes.)

revert() is not called for syntax and setting errors after [mode], so
the mode reset is only done for failures to set raster mode after
setting graphics mode.  normal colors can only be set after [mode],
and that is why reverting them should be unnecessary.
2017-04-03 09:21:00 +00:00
..
decode.c
decode.h
Makefile
Makefile.depend Add META_MODE support. 2015-06-13 19:20:56 +00:00
path.h o Teach vidcontrol(1) how to load vt(4) font. 2014-05-29 13:09:48 +00:00
vidcontrol.1 Add "vidcontrol -i active", to print out active vty number, 2016-01-19 13:09:20 +00:00
vidcontrol.c Save errno across revert(). 2017-04-03 09:21:00 +00:00