summaryrefslogtreecommitdiffstats
path: root/cpukit/telnetd/pty.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-26 23:10:25 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-26 23:10:25 +0000
commitedcb9827dc7f2d30e5cda9ed790b460d49ba9b94 (patch)
tree7c028303633e1f048d58947a2362a188a5198b1b /cpukit/telnetd/pty.c
parent2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-edcb9827dc7f2d30e5cda9ed790b460d49ba9b94.tar.bz2
2007-11-26 Joel Sherrill <joel.sherrill@oarcorp.com>
* telnetd/pty.c, telnetd/telnetd.c, telnetd/telnetd.h: Style clean up. Now works on gen5200/icecube.
Diffstat (limited to '')
-rw-r--r--cpukit/telnetd/pty.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/cpukit/telnetd/pty.c b/cpukit/telnetd/pty.c
index e93d83064f..a3201f7613 100644
--- a/cpukit/telnetd/pty.c
+++ b/cpukit/telnetd/pty.c
@@ -112,15 +112,18 @@ char * telnet_get_pty(int socket)
int ndx;
if (telnet_pty_inited) {
+#if 0
if ( rtems_telnetd_maximum_ptys < 5 )
rtems_telnetd_maximum_ptys = 5;
telnet_ptys = malloc( rtems_telnetd_maximum_ptys * sizeof (pty_t) );
+#endif
if ( !telnet_ptys ) {
return NULL;
}
for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
+
if (telnet_ptys[ndx].socket<0) {
struct timeval t;
/* set a long polling interval to save CPU time */
@@ -425,23 +428,28 @@ rtems_device_driver my_pty_initialize(
void *arg
)
{
-int ndx;
-rtems_status_code status ;
+ int ndx;
+ rtems_status_code status;
+
+ if ( rtems_telnetd_maximum_ptys < 5 )
+ rtems_telnetd_maximum_ptys = 5;
+
+ telnet_ptys = malloc( rtems_telnetd_maximum_ptys * sizeof (pty_t) );
/*
* Set up ptys
*/
for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
- telnet_ptys[ndx].devname=(char*)malloc(strlen("/dev/ptyXX")+1);
+ telnet_ptys[ndx].devname = (char*)malloc(strlen("/dev/ptyXX")+1);
sprintf(telnet_ptys[ndx].devname,"/dev/pty%X",ndx);
- telnet_ptys[ndx].ttyp=NULL;
- telnet_ptys[ndx].c_cflag=CS8|B9600;
- telnet_ptys[ndx].socket=-1;
- telnet_ptys[ndx].opened=FALSE;
- telnet_ptys[ndx].sb_ind=0;
- telnet_ptys[ndx].width=0;
- telnet_ptys[ndx].height=0;
+ telnet_ptys[ndx].ttyp = NULL;
+ telnet_ptys[ndx].c_cflag = CS8|B9600;
+ telnet_ptys[ndx].socket = -1;
+ telnet_ptys[ndx].opened = FALSE;
+ telnet_ptys[ndx].sb_ind = 0;
+ telnet_ptys[ndx].width = 0;
+ telnet_ptys[ndx].height = 0;
}