diff options
author | Denis Vlasenko | 2007-10-16 22:53:05 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-10-16 22:53:05 +0000 |
commit | 557613656317ccf401669dcc6681155bf2930c9f (patch) | |
tree | 4c1b64b064a304cf4aca3bc9696c6a962d677409 /networking | |
parent | 23c8128916d9a40b473557a11d431549a94604f1 (diff) | |
download | busybox-557613656317ccf401669dcc6681155bf2930c9f.zip busybox-557613656317ccf401669dcc6681155bf2930c9f.tar.gz |
fixes revealed by randomconfig run
Diffstat (limited to 'networking')
-rw-r--r-- | networking/telnetd.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c index 8cadc63..f1927e0 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -492,7 +492,11 @@ int telnetd_main(int argc, char **argv) while (ts) { struct tsession *next = ts->next; /* in case we free ts. */ if (ts->shell_pid == -1) { +#if !ENABLE_FEATURE_TELNETD_STANDALONE + return 0; +#else free_session(ts); +#endif } else { if (ts->size1 > 0) /* can write to pty */ FD_SET(ts->ptyfd, &wrfdset); @@ -552,8 +556,6 @@ int telnetd_main(int argc, char **argv) if (count < 0) { if (errno == EAGAIN) goto skip1; - if (IS_INETD) - return 0; goto kill_session; } ts->size1 -= count; @@ -569,8 +571,6 @@ int telnetd_main(int argc, char **argv) if (count < 0) { if (errno == EAGAIN) goto skip2; - if (IS_INETD) - return 0; goto kill_session; } ts->size2 -= count; @@ -601,8 +601,6 @@ int telnetd_main(int argc, char **argv) if (count <= 0) { if (count < 0 && errno == EAGAIN) goto skip3; - if (IS_INETD) - return 0; goto kill_session; } /* Ignore trailing NUL if it is there */ @@ -622,8 +620,6 @@ int telnetd_main(int argc, char **argv) if (count <= 0) { if (count < 0 && errno == EAGAIN) goto skip4; - if (IS_INETD) - return 0; goto kill_session; } ts->size2 += count; @@ -635,8 +631,14 @@ int telnetd_main(int argc, char **argv) ts = next; continue; kill_session: +#if !ENABLE_FEATURE_TELNETD_STANDALONE + return 0; +#else + if (IS_INETD) + return 0; free_session(ts); ts = next; +#endif } goto again; |