diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-06-20 22:21:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-06-20 22:21:05 +0000 |
commit | 8b8e1ee5073b9085901ade5280efa8c7cda4c5d1 (patch) | |
tree | adc88b63d588c1828e517fec8e39608f3d4ab3b3 /c/src/lib/libbsp/shared | |
parent | 2007-06-20 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-8b8e1ee5073b9085901ade5280efa8c7cda4c5d1.tar.bz2 |
2007-06-20 Joel Sherrill <joel.sherrill@OARcorp.com>
* bsppost.c: Split open of the console from the standard BSP code so it
is easier to stub out.
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r-- | c/src/lib/libbsp/shared/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/bsppost.c | 23 |
2 files changed, 7 insertions, 21 deletions
diff --git a/c/src/lib/libbsp/shared/ChangeLog b/c/src/lib/libbsp/shared/ChangeLog index 37510d3596..d4c23d1e62 100644 --- a/c/src/lib/libbsp/shared/ChangeLog +++ b/c/src/lib/libbsp/shared/ChangeLog @@ -1,3 +1,8 @@ +2007-06-20 Joel Sherrill <joel.sherrill@OARcorp.com> + + * bsppost.c: Split open of the console from the standard BSP code so it + is easier to stub out. + 2007-05-10 Till Straumann <strauman@slac.stanford.edu> * vmeUniverse/vmeUniverse.c: Changed types to silence diff --git a/c/src/lib/libbsp/shared/bsppost.c b/c/src/lib/libbsp/shared/bsppost.c index e86420ebb7..936c2969ca 100644 --- a/c/src/lib/libbsp/shared/bsppost.c +++ b/c/src/lib/libbsp/shared/bsppost.c @@ -20,26 +20,7 @@ void bsp_postdriver_hook(void) { - int stdin_fd, stdout_fd, stderr_fd; - int error_code = 'S' << 24 | 'T' << 16 | 'D' << 8; + extern void open_dev_console(void); - /* - * Attempt to open /dev/console. - */ - if ((stdin_fd = open("/dev/console", O_RDONLY, 0)) == -1) { - /* - * There may not be a console driver so this is OK. - */ - return; - } - - /* - * But if we find /dev/console once, we better find it twice more - * or something is REALLY wrong. - */ - if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred( error_code | '1' ); - - if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred( error_code | '2' ); + open_dev_console(); } |