mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Get rid of psock.h (bad idea); Add logic to clone the socket structure when wrapping the telnet connection as a character driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4349 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* net/net_clone.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <time.h>
|
||||
|
||||
#include <nuttx/net.h>
|
||||
#include <net/psock.h>
|
||||
#include <net/uip/uip.h>
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+8
-8
@@ -185,20 +185,20 @@ int net_releaselist(FAR struct socketlist *list)
|
||||
|
||||
if (crefs <= 0)
|
||||
{
|
||||
/* Close each open socket in the list
|
||||
* REVISIT: psock_close() will attempt to use semaphores.
|
||||
* If we actually are in the IDLE thread, then could this cause
|
||||
* problems? Probably not, it the task has exited and crefs is
|
||||
* zero, then there probably could not be a contender for the
|
||||
* semaphore.
|
||||
*/
|
||||
/* Close each open socket in the list
|
||||
* REVISIT: psock_close() will attempt to use semaphores.
|
||||
* If we actually are in the IDLE thread, then could this cause
|
||||
* problems? Probably not, if the task has exited and crefs is
|
||||
* zero, then there probably could not be a contender for the
|
||||
* semaphore.
|
||||
*/
|
||||
|
||||
for (ndx = 0; ndx < CONFIG_NSOCKET_DESCRIPTORS; ndx++)
|
||||
{
|
||||
FAR struct socket *psock = &list->sl_sockets[ndx];
|
||||
if (psock->s_crefs > 0)
|
||||
{
|
||||
(void)psock_close(psock);
|
||||
(void)psock_close(psock);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user