Used CFS instead of POSIX.
This commit is contained in:
parent
e12e794a74
commit
1ac4d7f501
1 changed files with 7 additions and 11 deletions
|
@ -29,14 +29,10 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki desktop environment
|
* This file is part of the Contiki desktop environment
|
||||||
*
|
*
|
||||||
* $Id: dhcp-client.c,v 1.1 2010/02/08 22:08:17 oliverschmidt Exp $
|
* $Id: dhcp-client.c,v 1.2 2010/02/08 22:26:19 oliverschmidt Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
#include "ctk/ctk.h"
|
#include "ctk/ctk.h"
|
||||||
#include "net/dhcpc.h"
|
#include "net/dhcpc.h"
|
||||||
|
@ -140,9 +136,9 @@ nullterminate(char *cptr)
|
||||||
static void
|
static void
|
||||||
apply_tcpipconfig(void)
|
apply_tcpipconfig(void)
|
||||||
{
|
{
|
||||||
int file = open("contiki.cfg", O_RDONLY);
|
int file = cfs_open("contiki.cfg", CFS_READ);
|
||||||
int size = read(file, uip_buf, 100);
|
int size = cfs_read(file, uip_buf, 100);
|
||||||
close(file);
|
cfs_close(file);
|
||||||
|
|
||||||
nullterminate(ipaddr);
|
nullterminate(ipaddr);
|
||||||
uiplib_ipaddrconv(ipaddr, &uip_buf[0]);
|
uiplib_ipaddrconv(ipaddr, &uip_buf[0]);
|
||||||
|
@ -158,9 +154,9 @@ apply_tcpipconfig(void)
|
||||||
uiplib_ipaddrconv(dnsserver, &uip_buf[12]);
|
uiplib_ipaddrconv(dnsserver, &uip_buf[12]);
|
||||||
#endif /* WITH_DNS */
|
#endif /* WITH_DNS */
|
||||||
|
|
||||||
file = open("contiki.cfg", O_WRONLY | O_CREAT | O_TRUNC);
|
file = cfs_open("contiki.cfg", CFS_WRITE);
|
||||||
write(file, uip_buf, size);
|
cfs_write(file, uip_buf, size);
|
||||||
close(file);
|
cfs_close(file);
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue