UNIX98-pty ci±g dalszy...

Marcin Dalecki dalecki w cs.net.pl
Śro, 17 Lut 1999, 00:29:04 CET


Dobry Wieczór!

Marcin tera wam pokazaæ, ¿e Marcin umieæ C++, i Marcin lepiej rozumieæ,
co to byæ libncurses, a co to byæ libtermcap, od autorów netkit-u :-).

Serio: ta ³ata jest na telnet-0.10-6 z  RawHide-a.
Ponadto, ¿e doda³em wspomaganie dla /dev/ptmx pod linux-em, to
równie¿ rozwi±za³em kilka drobniejszych problemów, które mi siê w
trakcie
tego nwine³y pod palce. Proszê pomownie o mo¿liwe rych³e w¿ucenie
tego do CVS.

branoc i narazie

PS. Jeszcze cos wyleczyæ dzisiaj?

--Marcin
-------------- nastêpna czê¶æ ---------
diff -ur netkit-telnet-0.10/telnet/telnet.cc netkit-telnet-0.10-new/telnet/telnet.cc
--- netkit-telnet-0.10/telnet/telnet.cc	Wed Mar 26 10:55:22 1997
+++ netkit-telnet-0.10-new/telnet/telnet.cc	Tue Feb 16 23:50:42 1999
@@ -57,12 +57,7 @@
 #include "netlink.h"
 #include "terminal.h"
 
-/*
- * Due to lossage in some linux distributions/kernel releases/libc versions
- * this must come *after* termios.h (which is included in externs.h)
- */
-#include <termcap.h>
-
+#include <term.h>
 
 #define	strip(x)	((x)&0x7f)
 
diff -ur netkit-telnet-0.10/telnetd/sys_term.c netkit-telnet-0.10-new/telnetd/sys_term.c
--- netkit-telnet-0.10/telnetd/sys_term.c	Sun Apr  6 03:05:20 1997
+++ netkit-telnet-0.10-new/telnetd/sys_term.c	Wed Feb 17 00:12:10 1999
@@ -426,6 +426,23 @@
 
 int getpty(void) {
     int p;
+#ifdef __linux__
+
+    /* Wed Feb 17 00:08:54 CET 1999  Marcin Dalecki <dalecki w cs.net.pl>:
+     *
+     * Use the clone device on modern systems..
+     */
+    if ((p = open("/dev/ptmx", O_RDWR)) >= 0) {
+        grantpt(p);
+        unlockpt(p);
+        fcntl(p, F_SETFL, O_NDELAY);
+        strcpy(line, ptsname(p));
+
+        return p;
+    }
+
+    return -1; /* sorry */
+#else
 #ifndef CRAY
     char *p1, *p2;
     int i,j;
@@ -487,6 +504,7 @@
 	}
     }
 #endif	/* CRAY */
+#endif
     return(-1);
 }
 #endif	/* convex */
diff -ur netkit-telnet-0.10/telnetd/telnetd.h netkit-telnet-0.10-new/telnetd/telnetd.h
--- netkit-telnet-0.10/telnetd/telnetd.h	Tue Jul 16 10:01:02 1996
+++ netkit-telnet-0.10-new/telnetd/telnetd.h	Tue Feb 16 23:54:08 1999
@@ -44,7 +44,6 @@
 #define	DIAG(a,b)
 #endif
 
-/* other external variables */
-extern	char **environ;
-extern	int errno;
-
+/* We need those for environ and errno */
+#include <unistd.h>
+#include <errno.h>
diff -ur netkit-telnet-0.10/telnetd/utility.c netkit-telnet-0.10-new/telnetd/utility.c
--- netkit-telnet-0.10/telnetd/utility.c	Sun Nov 24 17:33:22 1996
+++ netkit-telnet-0.10-new/telnetd/utility.c	Tue Feb 16 23:55:17 1999
@@ -94,7 +94,7 @@
 stilloob(s)
     int	s;		/* socket number */
 {
-    static struct timeval timeout = { 0 };
+    static struct timeval timeout = { 0, 0 };
     fd_set	excepts;
     int value;
 


Więcej informacji o liście dyskusyjnej pld-devel-pl