summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-05-29 07:42:02 +0000
committerRob Landley <rob@landley.net>2006-05-29 07:42:02 +0000
commit1ec5b2905484b7904aabb01f56c70265fb538c82 (patch)
tree87292bfd7e99ce26b226518e244f4a96914397f9 /networking
parenta6e131dab39ee67522687a56b39ed815b9ae15ec (diff)
downloadbusybox-w32-1ec5b2905484b7904aabb01f56c70265fb538c82.tar.gz
busybox-w32-1ec5b2905484b7904aabb01f56c70265fb538c82.tar.bz2
busybox-w32-1ec5b2905484b7904aabb01f56c70265fb538c82.zip
More size shrinkage.
Diffstat (limited to 'networking')
-rw-r--r--networking/telnetd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 5a11ffb8c..f2038395f 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -3,7 +3,7 @@
3 * Simple telnet server 3 * Simple telnet server
4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) 4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com)
5 * 5 *
6 * Licensed under GPL, see file LICENSE in this tarball for details. 6 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
7 * 7 *
8 * --------------------------------------------------------------------------- 8 * ---------------------------------------------------------------------------
9 * (C) Copyright 2000, Axis Communications AB, LUND, SWEDEN 9 * (C) Copyright 2000, Axis Communications AB, LUND, SWEDEN
@@ -260,21 +260,17 @@ make_new_session(int sockfd)
260 struct termios termbuf; 260 struct termios termbuf;
261 int pty, pid; 261 int pty, pid;
262 char tty_name[32]; 262 char tty_name[32];
263 struct tsession *ts = malloc(sizeof(struct tsession) + BUFSIZE * 2); 263 struct tsession *ts = xzalloc(sizeof(struct tsession) + BUFSIZE * 2);
264 264
265 ts->buf1 = (char *)(&ts[1]); 265 ts->buf1 = (char *)(&ts[1]);
266 ts->buf2 = ts->buf1 + BUFSIZE; 266 ts->buf2 = ts->buf1 + BUFSIZE;
267 267
268#ifdef CONFIG_FEATURE_TELNETD_INETD 268#ifdef CONFIG_FEATURE_TELNETD_INETD
269 ts->sockfd_read = 0;
270 ts->sockfd_write = 1; 269 ts->sockfd_write = 1;
271#else /* CONFIG_FEATURE_TELNETD_INETD */ 270#else /* CONFIG_FEATURE_TELNETD_INETD */
272 ts->sockfd = sockfd; 271 ts->sockfd = sockfd;
273#endif /* CONFIG_FEATURE_TELNETD_INETD */ 272#endif /* CONFIG_FEATURE_TELNETD_INETD */
274 273
275 ts->rdidx1 = ts->wridx1 = ts->size1 = 0;
276 ts->rdidx2 = ts->wridx2 = ts->size2 = 0;
277
278 /* Got a new connection, set up a tty and spawn a shell. */ 274 /* Got a new connection, set up a tty and spawn a shell. */
279 275
280 pty = getpty(tty_name); 276 pty = getpty(tty_name);