[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#605679: On GNU/kFreeBSD: no CTTY and incorrect baud rate



Package: xvt
Version: 2.1-20
Severity: important
Tags: patch
Usertags: kfreebsd
X-Debbugs-CC: debian-bsd@lists.debian.org

It is almost common knowledge that BSD systems need to use
ioctl with TIOCSCTTY to get a controlling TTY, and that they
need to use cfsetispeed(3) to set a required baud rate correctly.
GNU/kFreeBSD is no exception to this. However, the code
in "xvt-2.1/ttyinit.c" neglects to do so. Thus the terminal
emilator Xvt is broken in GNU/kFreeBSD.

Patch included, which is equally necessary on FreeBSD and OpenBSD!
The situation for GNU/Hurd is unknown to me.


Regards,

Mats Erik Andersson, DM



--- xvt-2.1.debian/ttyinit.c
+++ xvt-2.1/ttyinit.c
@@ -159,6 +159,9 @@
 #include <sys/ioctl.h>
 #define LIBC_OPENPTY
 #define SVR4_UTMP
+# if defined(__GLIBC__) && defined(__FreeBSD_kernel__)
+#  define SCTTY_IOCTL
+# endif
 #endif
 
 #ifdef UKC_LOCATIONS
@@ -507,11 +510,13 @@
 	if (!is_eightbit())
 		term.c_iflag |= ISTRIP;
 	term.c_oflag = OPOST | ONLCR;
-	term.c_cflag = B9600 | CREAD;
+	term.c_cflag = CREAD;
 	if (!is_eightbit())
 		term.c_cflag |=  PARENB | CS7;
 	else
 		term.c_cflag |= CS8;
+	cfsetispeed(&term, B9600);
+	cfsetospeed(&term, B9600);
 	term.c_lflag = ISIG | IEXTEN | ICANON | ECHO | ECHOE | ECHOK;
 #ifdef ECHOCTL
 	term.c_lflag |= ECHOCTL;

Attachment: signature.asc
Description: Digital signature


Reply to: