mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 02:13:33 +08:00
Re-verficatin of examples/telnetd after refactoring of fgets/readline functionality
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4358 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -518,8 +518,12 @@ static int telnetd_close(FAR struct file *filep)
|
||||
|
||||
psock_close(&priv->td_psock);
|
||||
|
||||
/* Release the driver memory. What if there are threads
|
||||
* waiting on td_exclsem? They will never be awakened!
|
||||
/* Release the driver memory. What if there are threads waiting on
|
||||
* td_exclsem? They will never be awakened! How could this happen?
|
||||
* crefs == 1 so there are no other open references to the driver.
|
||||
* But this could have if someone were trying to re-open the driver
|
||||
* after every other thread has closed it. That really should not
|
||||
* happen in the intended usage model.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(priv->td_exclsem.semcount == 0);
|
||||
@@ -733,6 +737,8 @@ FAR char *telnetd_driver(int sd, FAR struct telnetd_s *daemon)
|
||||
|
||||
/* Initialize the allocated driver instance */
|
||||
|
||||
sem_init(&priv->td_exclsem, 0, 1);
|
||||
|
||||
priv->td_state = STATE_NORMAL;
|
||||
priv->td_crefs = 0;
|
||||
priv->td_pending = 0;
|
||||
|
||||
Reference in New Issue
Block a user