From d3d2afdfacfa31a4936d8a764c3b6aa5f5a770bf Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 25 Oct 2005 11:17:35 +0000 Subject: 2005-10-25 Joel Sherrill * sapi/include/confdefs.h, telnetd/pty.c, telnetd/pty.h: Attempt to fix MAX_PTYS and provide a real configuration entry. This should make telnetd some suitable for inclusion in cpukit. --- cpukit/telnetd/pty.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'cpukit/telnetd/pty.c') diff --git a/cpukit/telnetd/pty.c b/cpukit/telnetd/pty.c index c19d05db37..38aa0a1c97 100644 --- a/cpukit/telnetd/pty.c +++ b/cpukit/telnetd/pty.c @@ -45,10 +45,7 @@ #define IAC_SE 240 #define IAC_EOR 239 -struct pty_tt; -typedef struct pty_tt pty_t; - -struct pty_tt { +typedef struct { char *devname; struct rtems_termios_tty *ttyp; tcflag_t c_cflag; @@ -57,11 +54,12 @@ struct pty_tt { int last_cr; int iac_mode; -}; +} pty_t; int ptys_initted=FALSE; -pty_t ptys[MAX_PTYS]; +pty_t *ptys; +int rtems_telnetd_maximum_ptys; /* This procedure returns the devname for a pty slot free. * If not slot availiable (field socket>=0) @@ -71,7 +69,7 @@ pty_t ptys[MAX_PTYS]; char * get_pty(int socket) { int ndx; if (!ptys_initted) return NULL; - for (ndx=0;ndxc_cflag; } else { return -1; @@ -217,7 +215,7 @@ static int ptyPollInitialize(int major,int minor,void * arg) { rtems_libio_open_close_args_t * args = arg; struct termios t; - if (minoriop->data1; @@ -230,7 +228,7 @@ ptyPollInitialize(int major,int minor,void * arg) { /*-----------------------------------------------------------*/ static int ptyShutdown(int major,int minor,void * arg) { - if (minor=0) close(ptys[minor].socket); ptys[minor].socket=-1; @@ -246,7 +244,7 @@ ptyShutdown(int major,int minor,void * arg) { static int ptyPollWrite(int minor, const char * buf,int len) { int count; - if (minor