Free up unused file descriptors.

This commit is contained in:
oliverschmidt 2008-02-28 21:56:47 +00:00
parent 368d389970
commit 8a4890c9e5
2 changed files with 14 additions and 6 deletions

View file

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: contiki-main.c,v 1.3 2008/02/17 14:12:52 oliverschmidt Exp $ * $Id: contiki-main.c,v 1.4 2008/02/28 21:56:47 oliverschmidt Exp $
*/ */
#include <string.h> #include <string.h>
@ -81,12 +81,16 @@ main(void)
{ {
struct ethernet_config *ethernet_config; struct ethernet_config *ethernet_config;
close(STDIN_FILENO);
close(STDOUT_FILENO);
#if !UIP_LOGGING && !LOG_CONF_ENABLED
close(STDERR_FILENO);
#endif /* !WITH_PFS */
process_init(); process_init();
#if 1 #if 1
ethernet_config = config_read("contiki.cfg"); ethernet_config = config_read("contiki.cfg");
#else #else
{ {
static struct ethernet_config config = {0xDE08, "cs8900a.eth"}; static struct ethernet_config config = {0xDE08, "cs8900a.eth"};

View file

@ -30,7 +30,7 @@
* *
* Author: Oliver Schmidt <ol.sc@web.de> * Author: Oliver Schmidt <ol.sc@web.de>
* *
* $Id: contiki-main.c,v 1.18 2008/02/17 14:13:07 oliverschmidt Exp $ * $Id: contiki-main.c,v 1.19 2008/02/28 21:57:09 oliverschmidt Exp $
*/ */
#include <string.h> #include <string.h>
@ -81,12 +81,16 @@ main(void)
{ {
struct ethernet_config *ethernet_config; struct ethernet_config *ethernet_config;
close(STDIN_FILENO);
close(STDOUT_FILENO);
#if !UIP_LOGGING && !LOG_CONF_ENABLED
close(STDERR_FILENO);
#endif /* !WITH_PFS */
process_init(); process_init();
#if 1 #if 1
ethernet_config = config_read("contiki.cfg"); ethernet_config = config_read("contiki.cfg");
#else #else
{ {
static struct ethernet_config config = {0xDE08, "cs8900a.eth"}; static struct ethernet_config config = {0xDE08, "cs8900a.eth"};