diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2017-08-16 15:14:46 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2017-08-16 15:14:46 +0000 |
| commit | 03096857fdd2d284190f2e48c5a0251189eb6730 (patch) | |
| tree | 5a9f41cd99e669f0f26d4f967682ca3fa5c3b953 /usr.sbin/vidcontrol | |
| parent | 7dea76609b97c458a43d534d6344f35605404b84 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/vidcontrol')
| -rw-r--r-- | usr.sbin/vidcontrol/vidcontrol.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index 0896d201275d..bd0b8ddaf2cb 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -154,7 +154,7 @@ revert(void) ioctl(0, VT_ACTIVATE, cur_info.active_vty); - fprintf(stderr, "\033[=%dA", cur_info.console_info.mv_ovscan); + ioctl(0, KDSBORDER, cur_info.console_info.mv_ovscan); fprintf(stderr, "\033[=%dH", cur_info.console_info.mv_rev.fore); fprintf(stderr, "\033[=%dI", cur_info.console_info.mv_rev.back); @@ -910,11 +910,15 @@ set_border_color(char *arg) { int color; - if ((color = get_color_number(arg)) != -1) { - fprintf(stderr, "\033[=%dA", color); + color = get_color_number(arg); + if (color == -1) { + revert(); + errx(1, "invalid color '%s'", arg); + } + if (ioctl(0, KDSBORDER, color) != 0) { + revert(); + err(1, "ioctl(KD_SBORDER)"); } - else - usage(); } static void |
