Skip to close acceptsd since it is already closed in SIOCTELNET handler
Change-Id: I669224fd5cd44162bb67c8316b56348f7f298883 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
579327a972
commit
d6e450e39a
@ -83,7 +83,7 @@ struct telnetd_s
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
@ -250,19 +250,15 @@ static int telnetd_daemon(int argc, FAR char *argv[])
|
||||
acceptsd = accept(listensd, &addr.generic, &accptlen);
|
||||
if (acceptsd < 0)
|
||||
{
|
||||
/* Accept failed */
|
||||
|
||||
int errval = errno;
|
||||
|
||||
/* Just continue if a signal was received */
|
||||
|
||||
if (errval == EINTR)
|
||||
if (errno == EINTR)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
nerr("ERROR: accept failed: %d\n", errval);
|
||||
nerr("ERROR: accept failed: %d\n", errno);
|
||||
goto errout_with_socket;
|
||||
}
|
||||
}
|
||||
@ -311,7 +307,7 @@ static int telnetd_daemon(int argc, FAR char *argv[])
|
||||
if (drvrfd < 0)
|
||||
{
|
||||
nerr("ERROR: Failed to open %s: %d\n", session.ts_devpath, errno);
|
||||
goto errout_with_acceptsd;
|
||||
goto errout_with_socket;
|
||||
}
|
||||
|
||||
/* Use this driver as stdin, stdout, and stderror */
|
||||
@ -337,7 +333,7 @@ static int telnetd_daemon(int argc, FAR char *argv[])
|
||||
if (pid < 0)
|
||||
{
|
||||
nerr("ERROR: Failed start the telnet session: %d\n", errno);
|
||||
goto errout_with_acceptsd;
|
||||
goto errout_with_socket;
|
||||
}
|
||||
|
||||
/* Forget about the connection. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user