1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

Don't call driver close unless we have one.

This commit is contained in:
Poul-Henning Kamp 2004-10-12 21:40:41 +00:00
parent 9e0dd54fea
commit 43c72732aa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136456

View File

@ -3155,7 +3155,8 @@ ttyopen(struct cdev *dev, int flag, int mode, struct thread *td)
tp->t_actout = TRUE; tp->t_actout = TRUE;
out: out:
splx(s); splx(s);
if (!(tp->t_state & TS_ISOPEN) && tp->t_wopeners == 0) if (!(tp->t_state & TS_ISOPEN) && tp->t_wopeners == 0 &&
tp->t_close != NULL)
tp->t_close(tp); tp->t_close(tp);
return (error); return (error);
} }
@ -3168,7 +3169,8 @@ ttyclose(struct cdev *dev, int flag, int mode, struct thread *td)
tp = dev->si_tty; tp = dev->si_tty;
ttyld_close(tp, flag); ttyld_close(tp, flag);
ttyldoptim(tp); ttyldoptim(tp);
tp->t_close(tp); if (tp->t_close != NULL)
tp->t_close(tp);
tty_close(tp); tty_close(tp);
tp->t_do_timestamp = 0; tp->t_do_timestamp = 0;
if (tp->t_pps != NULL) if (tp->t_pps != NULL)