On Tue, Mar 17, 2015 at 07:31:12PM +0900, 김혜진 wrote: > Hi. All > > I found an issue of telnetd that it loops infinitely when client > disconnected abnormally on working. > like client is killed by outside. > > On embedded system, this issue make that cpu occupation goes high. > > In this case : > select() returns 1, means socket fd has something changes. > but, read()/write() after select() gets an error because client already > disconnected.
read does not return an error; it returns 0, indicating EOF. > attached patch help prevent this issue. > plz, check. The patch as written does not seem correct. There is no justification for killing the child process with SIGKILL; this is a very bad practice and precludes any sort of cleanup it may need to do. Unless it's specifically written not to, the child running in the telnet session should automatically terminate when it loses its controlling terminal, which should happen when the telnet session exits. Can you clarify what exactly is going wrong for you? Rich _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
