Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 May 2021 07:45:40 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c66c9ae5dc4b - stable/12 - ttydev_write: prevent stops while terminal is busied
Message-ID:  <202105250745.14P7jePY098294@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c66c9ae5dc4b11de990fd50627f62398ec88e8d1

commit c66c9ae5dc4b11de990fd50627f62398ec88e8d1
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-05-13 01:35:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-05-25 07:32:13 +0000

    ttydev_write: prevent stops while terminal is busied
    
    PR:     255816
    
    (cherry picked from commit 8cf912b017a04a2eec01fbaa1f7b9ef556403ede)
---
 sys/kern/tty.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index eea5d1b26ddd..f80ffd4921e6 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -515,7 +515,7 @@ static int
 ttydev_write(struct cdev *dev, struct uio *uio, int ioflag)
 {
 	struct tty *tp = dev->si_drv1;
-	int error;
+	int defer, error;
 
 	error = ttydev_enter(tp);
 	if (error)
@@ -539,7 +539,9 @@ ttydev_write(struct cdev *dev, struct uio *uio, int ioflag)
 		}
 
 		tp->t_flags |= TF_BUSY_OUT;
+		defer = sigdeferstop(SIGDEFERSTOP_ERESTART);
 		error = ttydisc_write(tp, uio, ioflag);
+		sigallowstop(defer);
 		tp->t_flags &= ~TF_BUSY_OUT;
 		cv_signal(&tp->t_outserwait);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105250745.14P7jePY098294>