diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-02 08:58:48 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-05-08 06:50:17 +0200 |
commit | 8bd38d645ca2a3bc481a2c1dbfa78fbcb9882378 (patch) | |
tree | 8a3bd431075685a3aa212af743e17dcfe134ea00 /rtemsbsd/rtems/rtems-bsd-init-dhcp.c | |
parent | rc_conf: Do not create directories used by dhcpcd (diff) | |
download | rtems-libbsd-8bd38d645ca2a3bc481a2c1dbfa78fbcb9882378.tar.bz2 |
dhcpcd: Add rtems_dhcpcd_start()
Use it throughout to start the DHCP client (dhcpcd).
Diffstat (limited to 'rtemsbsd/rtems/rtems-bsd-init-dhcp.c')
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-init-dhcp.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/rtemsbsd/rtems/rtems-bsd-init-dhcp.c b/rtemsbsd/rtems/rtems-bsd-init-dhcp.c index 1115e40a..e0a298f7 100644 --- a/rtemsbsd/rtems/rtems-bsd-init-dhcp.c +++ b/rtemsbsd/rtems/rtems-bsd-init-dhcp.c @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2009-2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2009, 2018 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -38,36 +38,17 @@ */ #include <rtems/bsd/bsd.h> +#include <rtems/dhcpcd.h> -#include <assert.h> #include <sysexits.h> -#include <machine/rtems-bsd-commands.h> - #include <bsp.h> -static void -dhcpcd_task(rtems_task_argument arg) -{ - int exit_code; - char *dhcpcd[] = { - "dhcpcd", - NULL - }; - - (void)arg; - - exit_code = rtems_bsd_command_dhcpcd(RTEMS_BSD_ARGC(dhcpcd), dhcpcd); - assert(exit_code == EX_OK); - (void)exit_code; -} - rtems_status_code rtems_bsd_initialize_dhcp(void) { rtems_status_code sc; int exit_code; - rtems_id id; sc = rtems_bsd_initialize(); if (sc != RTEMS_SUCCESSFUL) { @@ -79,21 +60,11 @@ rtems_bsd_initialize_dhcp(void) return (RTEMS_UNSATISFIED); } - sc = rtems_task_create( - rtems_build_name('D', 'H', 'C', 'P'), - RTEMS_MAXIMUM_PRIORITY - 1, - 2 * RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &id - ); + sc = rtems_dhcpcd_start(NULL); if (sc != RTEMS_SUCCESSFUL) { return (RTEMS_UNSATISFIED); } - sc = rtems_task_start(id, dhcpcd_task, 0); - assert(sc == RTEMS_SUCCESSFUL); - return (RTEMS_SUCCESSFUL); } |