mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-28 16:43:09 +00:00
There have been a few occasions where some actions could dereference
uninitialized tty pointers early during boot; it got very obvious when pressing Alt-F11 after a boot -c.
This commit is contained in:
parent
d79940da0a
commit
e03e5bb758
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7739
@ -1492,7 +1492,8 @@ set_emulation_mode(struct video_state *svsp, int mode)
|
||||
|
||||
svsp->vt_pure_mode = M_HPVT;
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
if (svsp->vs_tty)
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
|
||||
svsp->scrr_len = svsp->screen_rows;
|
||||
svsp->scrr_end = svsp->scrr_len - 1;
|
||||
@ -1512,14 +1513,16 @@ set_emulation_mode(struct video_state *svsp, int mode)
|
||||
if (svsp->force24 && svsp->screen_rows == 25)
|
||||
svsp->screen_rows = 24;
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
if (svsp->vs_tty)
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
|
||||
svsp->scrr_len = svsp->screen_rows;
|
||||
svsp->scrr_end = svsp->scrr_len - 1;
|
||||
}
|
||||
|
||||
#if PCVT_SIGWINCH
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
if (svsp->vs_tty && svsp->vs_tty->t_pgrp)
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
#endif /* PCVT_SIGWINCH */
|
||||
|
||||
}
|
||||
@ -1796,15 +1799,20 @@ vt_col(struct video_state *svsp, int cols)
|
||||
|
||||
/* Update winsize struct to reflect screen size */
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
|
||||
if(svsp->vs_tty)
|
||||
{
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_xpixel = (cols == SCR_COL80)? 720: 1056;
|
||||
svsp->vs_tty->t_winsize.ws_ypixel = 400;
|
||||
svsp->vs_tty->t_winsize.ws_xpixel =
|
||||
(cols == SCR_COL80)? 720: 1056;
|
||||
svsp->vs_tty->t_winsize.ws_ypixel = 400;
|
||||
|
||||
#if PCVT_SIGWINCH
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
#endif /* PCVT_SIGWINCH */
|
||||
if(svsp->vs_tty->t_pgrp)
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
#endif /* PCVT_SIGWINCH */
|
||||
}
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
@ -742,11 +742,15 @@ set_screen_size(struct video_state *svsp, int size)
|
||||
|
||||
/* Update tty to reflect screen size */
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
|
||||
svsp->vs_tty->t_winsize.ws_xpixel =
|
||||
(svsp->maxcol == 80)? 720: 1056;
|
||||
svsp->vs_tty->t_winsize.ws_ypixel = 400;
|
||||
|
||||
if (svsp->vs_tty)
|
||||
{
|
||||
svsp->vs_tty->t_winsize.ws_col = svsp->maxcol;
|
||||
svsp->vs_tty->t_winsize.ws_xpixel =
|
||||
(svsp->maxcol == 80)? 720: 1056;
|
||||
svsp->vs_tty->t_winsize.ws_ypixel = 400;
|
||||
svsp->vs_tty->t_winsize.ws_row =
|
||||
svsp->screen_rows;
|
||||
}
|
||||
/* screen_rows already calculated in set_charset() */
|
||||
if(svsp->vt_pure_mode == M_HPVT && svsp->labels_on)
|
||||
{
|
||||
@ -756,13 +760,13 @@ set_screen_size(struct video_state *svsp, int size)
|
||||
sw_ufkl(svsp);
|
||||
}
|
||||
|
||||
svsp->vs_tty->t_winsize.ws_row = svsp->screen_rows;
|
||||
|
||||
svsp->scrr_len = svsp->screen_rows;
|
||||
svsp->scrr_end = svsp->scrr_len - 1;
|
||||
|
||||
#if PCVT_SIGWINCH
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
if (svsp->vs_tty && svsp->vs_tty->t_pgrp)
|
||||
pgsignal(svsp->vs_tty->t_pgrp, SIGWINCH, 1);
|
||||
#endif /* PCVT_SIGWINCH */
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user