Patch to use openpty(). OK pval@, mcbride@.

This commit is contained in:
millert 2004-09-16 17:07:11 +00:00
parent 4a4c38410f
commit de834ae38e
2 changed files with 33 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.33 2004/04/09 04:24:44 jolan Exp $ # $OpenBSD: Makefile,v 1.34 2004/09/16 17:07:11 millert Exp $
DISTNAME= aterm-0.4.2 DISTNAME= aterm-0.4.2
CATEGORIES= x11 CATEGORIES= x11
@ -16,15 +16,14 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=aterm/}
USE_X11= Yes USE_X11= Yes
CONFIGURE_STYLE= gnu CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --enable-xgetdefault --enable-ttygid --enable-utmp CONFIGURE_ARGS= --enable-xgetdefault --enable-ttygid --enable-utmp
CONFIGURE_ENV= CPPFLAGS="-I${X11BASE}/include" CONFIGURE_ENV= CPPFLAGS="-I${X11BASE}/include" LIBS="-lutil"
FLAVORS= big5 lite FLAVORS= big5 lite
FLAVOR?= FLAVOR?=
.if ${FLAVOR:L:Mbig5} .if ${FLAVOR:L:Mbig5}
RUN_DEPENDS= ${LOCALBASE}/lib/X11/fonts/chinese/taipei16.pcf.gz::chinese/taipeifonts RUN_DEPENDS= ${LOCALBASE}/lib/X11/fonts/chinese/taipei16.pcf.gz::chinese/taipeifonts
PATCH_LIST= patch-src_Makefile_in \ PATCH_LIST= patch-src_Makefile_in patch-src_command_c
patch-src_command_c
CONFIGURE_ARGS+= --enable-big5 CONFIGURE_ARGS+= --enable-big5
@ -32,7 +31,7 @@ post-patch:
@cd ${FILESDIR}; cp -f {cli_xcin.c,protocol.h,state.h} \ @cd ${FILESDIR}; cp -f {cli_xcin.c,protocol.h,state.h} \
${WRKSRC}/src ${WRKSRC}/src
.else .else
PATCH_LIST= PATCH_LIST= patch-src_command_c
.endif .endif
.if ${FLAVOR:L:Mlite} .if ${FLAVOR:L:Mlite}

View File

@ -1,29 +1,54 @@
--- src/command.c.orig Tue Apr 17 10:27:59 2001 --- src/command.c.orig Thu Sep 6 10:38:07 2001
+++ src/command.c Tue Apr 17 10:31:19 2001 +++ src/command.c Wed Sep 15 20:38:55 2004
@@ -2128,11 +2128,17 @@ @@ -477,6 +477,16 @@ get_pty(void)
ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0);
if (ptydev == NULL)
goto Failed;
+#elif defined (__OpenBSD__)
+ int sfd;
+ static char tty_name[16];
+
+ ptydev = ttydev = tty_name;
+
+ if (openpty(&fd, &sfd, tty_name, NULL, NULL) < 0)
+ goto Failed;
+ close(sfd);
+
#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__)
{
extern char *ptsname();
@@ -2148,11 +2158,23 @@ process_x_event(XEvent * ev)
static int bypass_keystate = 0; static int bypass_keystate = 0;
int reportmode; int reportmode;
static int csrO = 0; /* Hops - csr offset in thumb/slider */ static int csrO = 0; /* Hops - csr offset in thumb/slider */
+#ifdef ZH
+ int k_status; + int k_status;
+ char kbuf[256]; + char kbuf[256];
+#endif
/* to give proper Scroll behaviour */ /* to give proper Scroll behaviour */
switch (ev->type) { switch (ev->type) {
case KeyPress: case KeyPress:
- lookup_key(ev); - lookup_key(ev);
+#ifdef ZH
+ k_status = send_key(Xdisplay, TermWin.parent, &ev->xkey, kbuf); + k_status = send_key(Xdisplay, TermWin.parent, &ev->xkey, kbuf);
+ if (!k_status) + if (!k_status)
+ lookup_key(ev); + lookup_key(ev);
+ else if (kbuf[0]) + else if (kbuf[0])
+ tt_write(kbuf, strlen(kbuf)); + tt_write(kbuf, strlen(kbuf));
+#else
+ lookup_key(ev);
+#endif
break; break;
case ClientMessage: case ClientMessage:
@@ -2197,6 +2203,7 @@ @@ -2217,6 +2239,9 @@ process_x_event(XEvent * ev)
case FocusIn: case FocusIn:
if (!TermWin.focus) { if (!TermWin.focus) {
+#ifdef ZH
+ send_FocusIn(Xdisplay, TermWin.parent); + send_FocusIn(Xdisplay, TermWin.parent);
+#endif
TermWin.focus = 1; TermWin.focus = 1;
#ifdef OFF_FOCUS_FADING #ifdef OFF_FOCUS_FADING
if( rs_fade != NULL ) if( rs_fade != NULL )