ports/90104: kterm tty line speed problem

n-kogane at syd.odn.ne.jp n-kogane at syd.odn.ne.jp
Thu Dec 8 13:50:19 UTC 2005


>Number:         90104
>Category:       ports
>Synopsis:       kterm tty line speed problem
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 08 13:50:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Nobuyuki Koganemaru
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
KOGANEMARU Computer Engineering Service Corporation.
>Environment:
System: FreeBSD kcesx30.koganemaru.co.jp 5.4-STABLE FreeBSD 5.4-STABLE #0: Tue Dec 6 17:35:20 2005 root at kcesx30.koganemaru.co.jp:/usr/src.stable/sys/i386/compile/MYPCX30 i386


>Description:
	ports/japanese/kterm:
	kterm returns 13 as a speed of tty.
	normal speed is 9600.
>How-To-Repeat:
	test program:

#include <stdio.h>
#include <termios.h>

int
main(argc, argv)
	int argc;
	char *argv[];
{
	struct termios tbuf;
	struct winsize ws;
	speed_t speed;
	int screenheight, realscreenheight, screenwidth;

	if (ioctl(1, TIOCGWINSZ, (char *)&ws) < 0)
		ws.ws_col = ws.ws_row = 0;
	if (tcgetattr(1, &tbuf) < 0) {
		speed = B9600;
		printf("tcgetattr < 0\n");
	}
	else {
		speed = cfgetospeed(&tbuf);
	}
	printf("c_ispeed=%d\n", tbuf.c_ispeed);
	printf("c_ospeed=%d\n", tbuf.c_ospeed);
	printf("speed=%d\n", speed);
	if (speed < B1200)
		screenheight = 9;
	else if (speed == B1200)
		screenheight = 14;
	else if (ws.ws_row != 0)
		screenheight = ws.ws_row;
	else
		screenheight = 24;
	printf("screenheight=%d\n", screenheight);
	if ((realscreenheight = ws.ws_row) == 0)
		realscreenheight = 24;
	printf("realscreenheight=%d\n", realscreenheight);
	if ((screenwidth = ws.ws_col) == 0)
		screenwidth = 80;
	printf("screenwidth=%d\n", screenwidth);
}

>Fix:


--- main.c.orig	Thu Dec  8 19:33:17 2005
+++ main.c	Thu Dec  8 19:39:26 2005
@@ -237,7 +237,9 @@
 #endif
 #else /* } !SYSV { */			/* BSD systems */
 #ifndef linux
+#ifndef USE_POSIX_TERMIOS
 #include <sgtty.h>
+#endif
 #endif
 #include <sys/resource.h>
 #define HAS_UTMP_UT_HOST

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list