summaryrefslogtreecommitdiff
path: root/apps/netutils
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-01 21:10:40 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-01 21:10:40 +0000
commit7fb190093c485279c8c89b53578bb297ab1170e2 (patch)
treef543747f552741b311effcf385e00bda0be40e74 /apps/netutils
parent37259910ba73b71e4c32e5913e4d44c245c4502d (diff)
downloadnuttx-7fb190093c485279c8c89b53578bb297ab1170e2.tar.gz
nuttx-7fb190093c485279c8c89b53578bb297ab1170e2.tar.bz2
nuttx-7fb190093c485279c8c89b53578bb297ab1170e2.zip
Re-verficatin of examples/telnetd after refactoring of fgets/readline functionality
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4358 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils')
-rw-r--r--apps/netutils/telnetd/telnetd_driver.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/netutils/telnetd/telnetd_driver.c b/apps/netutils/telnetd/telnetd_driver.c
index 7d36e9d2d..eb43012c4 100644
--- a/apps/netutils/telnetd/telnetd_driver.c
+++ b/apps/netutils/telnetd/telnetd_driver.c
@@ -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;