Cosmetic changes

This commit is contained in:
Gregory Nutt 2015-09-02 16:49:17 -06:00
parent ae0d87c0cb
commit 9cc360ab75
7 changed files with 17 additions and 14 deletions

View File

@ -28,4 +28,4 @@ config EXAMPLES_POLL_NETMASK
hex "Network Mask" hex "Network Mask"
default 0xffffff00 default 0xffffff00
endif endif # EXAMPLES_POLL

View File

@ -63,7 +63,7 @@
#include "poll_internal.h" #include "poll_internal.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#define IOBUFFER_SIZE 80 #define IOBUFFER_SIZE 80
@ -298,7 +298,7 @@ static void net_configure(void)
uint8_t mac[IFHWADDRLEN]; uint8_t mac[IFHWADDRLEN];
#endif #endif
/* Configure uIP */ /* Configure the network */
/* Many embedded network interfaces must have a software assigned MAC */ /* Many embedded network interfaces must have a software assigned MAC */
#ifdef CONFIG_EXAMPLES_POLL_NOMAC #ifdef CONFIG_EXAMPLES_POLL_NOMAC
@ -343,7 +343,7 @@ void *net_listener(pthread_addr_t pvarg)
int ret; int ret;
int i; int i;
/* Configure uIP */ /* Configure the network */
net_configure(); net_configure();

View File

@ -63,7 +63,7 @@
#include "poll_internal.h" #include "poll_internal.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#define IOBUFFER_SIZE 80 #define IOBUFFER_SIZE 80
@ -91,7 +91,7 @@ static void net_configure(void)
uint8_t mac[IFHWADDRLEN]; uint8_t mac[IFHWADDRLEN];
#endif #endif
/* Configure uIP */ /* Configure the network */
/* Many embedded network interfaces must have a software assigned MAC */ /* Many embedded network interfaces must have a software assigned MAC */
#ifdef CONFIG_EXAMPLES_POLL_NOMAC #ifdef CONFIG_EXAMPLES_POLL_NOMAC
@ -232,7 +232,7 @@ void *net_reader(pthread_addr_t pvarg)
socklen_t addrlen; socklen_t addrlen;
int optval; int optval;
/* Configure uIP */ /* Configure the network */
net_configure(); net_configure();
@ -288,6 +288,7 @@ void *net_reader(pthread_addr_t pvarg)
printf("net_reader: accept failure: %d\n", errno); printf("net_reader: accept failure: %d\n", errno);
continue; continue;
} }
printf("net_reader: Connection accepted on sd=%d\n", acceptsd); printf("net_reader: Connection accepted on sd=%d\n", acceptsd);
/* Configure to "linger" until all data is sent when the socket is closed */ /* Configure to "linger" until all data is sent when the socket is closed */
@ -295,11 +296,12 @@ void *net_reader(pthread_addr_t pvarg)
#ifdef POLL_HAVE_SOLINGER #ifdef POLL_HAVE_SOLINGER
ling.l_onoff = 1; ling.l_onoff = 1;
ling.l_linger = 30; /* timeout is seconds */ ling.l_linger = 30; /* timeout is seconds */
if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0) if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
{ {
printf("net_reader: setsockopt SO_LINGER failure: %d\n", errno); printf("net_reader: setsockopt SO_LINGER failure: %d\n", errno);
goto errout_with_acceptsd; goto errout_with_acceptsd;
} }
#endif #endif
/* Handle incoming messsages on the connection. */ /* Handle incoming messsages on the connection. */

View File

@ -47,7 +47,7 @@
#include <pthread.h> #include <pthread.h>
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_DISABLE_POLL #ifdef CONFIG_DISABLE_POLL

View File

@ -56,7 +56,7 @@
#include "poll_internal.h" #include "poll_internal.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_DEV_CONSOLE) && !defined(CONFIG_DEV_LOWCONSOLE) #if defined(CONFIG_DEV_CONSOLE) && !defined(CONFIG_DEV_LOWCONSOLE)
@ -105,6 +105,7 @@ void *poll_listener(pthread_addr_t pvarg)
/* Open the FIFO for non-blocking read */ /* Open the FIFO for non-blocking read */
printf("poll_listener: Opening %s for non-blocking read\n", FIFO_PATH1); printf("poll_listener: Opening %s for non-blocking read\n", FIFO_PATH1);
fd = open(FIFO_PATH1, O_RDONLY|O_NONBLOCK); fd = open(FIFO_PATH1, O_RDONLY|O_NONBLOCK);
if (fd < 0) if (fd < 0)
{ {

View File

@ -54,7 +54,7 @@
#include "poll_internal.h" #include "poll_internal.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************

View File

@ -55,7 +55,7 @@
#include "poll_internal.h" #include "poll_internal.h"
/**************************************************************************** /****************************************************************************
* Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************