source: rtems/testsuites/samples/pppd/init.c @ 1d39e96

5
Last change on this file since 1d39e96 was 51b3cbca, checked in by Sebastian Huber <sebastian.huber@…>, on 10/04/18 at 13:23:25

tests: Use rtems_task_exit()

Update #3533.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <stdio.h>
15#include <stdlib.h>
16#include <string.h>
17
18#define CONFIGURE_INIT
19#include "system.h"
20
21#include <rtems/rtems_bsdnet.h>
22#include <rtems/rtemspppd.h>
23#include <rtems/shell.h>
24#include "netconfig.h"
25#include <tmacros.h>
26
27const char rtems_test_name[] = "PPPD";
28
29static void notification(int fd, int seconds_remaining, void *arg)
30{
31  printf(
32    "Press any key to start pppd (%is remaining)\n",
33    seconds_remaining
34  );
35}
36
37rtems_task Init(rtems_task_argument argument)
38{
39  rtems_status_code status;
40
41  rtems_print_printer_fprintf_putc(&rtems_test_printer);
42
43  TEST_BEGIN();
44
45  status = rtems_shell_wait_for_input(
46    STDIN_FILENO,
47    10,
48    notification,
49    NULL
50  );
51  if (status != RTEMS_SUCCESSFUL) {
52    TEST_END();
53    exit( 0 );
54  }
55
56  /* initialize network */
57  rtems_bsdnet_initialize_network();
58  rtems_pppd_initialize();
59  pppdapp_initialize();
60  rtems_task_exit();
61}
Note: See TracBrowser for help on using the repository browser.