Skip to content
Snippets Groups Projects
Commit d89adb76 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

If write buffering is enabled, then it is necessary to release the write...

If write buffering is enabled, then it is necessary to release the write buffer resources (callback structure) when the socket is closed
parent 10d4657d
No related branches found
No related tags found
No related merge requests found
...@@ -215,7 +215,7 @@ static void telnetd_getchar(FAR struct telnetd_dev_s *priv, uint8_t ch, ...@@ -215,7 +215,7 @@ static void telnetd_getchar(FAR struct telnetd_dev_s *priv, uint8_t ch,
* Name: telnetd_receive * Name: telnetd_receive
* *
* Description: * Description:
* Process a received telenet buffer * Process a received Telnet buffer
* *
****************************************************************************/ ****************************************************************************/
...@@ -500,12 +500,20 @@ static int telnetd_close(FAR struct file *filep) ...@@ -500,12 +500,20 @@ static int telnetd_close(FAR struct file *filep)
} }
else else
{ {
/* Unregister the character driver */ /* Un-register the character driver */
ret = unregister_driver(devpath); ret = unregister_driver(devpath);
if (ret < 0) if (ret < 0)
{ {
nlldbg("Failed to unregister the driver %s: %d\n", devpath, ret); /* NOTE: a return value of -EBUSY is not an error, it simply
* means that the Telnet driver is busy now and cannot be
* registered now because there are other sessions using the
* connection. The driver will be properly unregistered when
* the final session terminates.
*/
nlldbg("Failed to unregister the driver %s: %d\n",
devpath, ret);
} }
free(devpath); free(devpath);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment