Changeset 8b8e1ee5 in rtems


Ignore:
Timestamp:
Jun 20, 2007, 10:21:05 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
5a8bc44
Parents:
442e430d
Message:

2007-06-20 Joel Sherrill <joel.sherrill@…>

  • bsppost.c: Split open of the console from the standard BSP code so it is easier to stub out.
Location:
c/src/lib/libbsp/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/ChangeLog

    r442e430d r8b8e1ee5  
     12007-06-20      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * bsppost.c: Split open of the console from the standard BSP code so it
     4        is easier to stub out.
     5
    162007-05-10      Till Straumann <strauman@slac.stanford.edu>
    27
  • c/src/lib/libbsp/shared/bsppost.c

    r442e430d r8b8e1ee5  
    2121void bsp_postdriver_hook(void)
    2222{
    23   int stdin_fd, stdout_fd, stderr_fd;
    24   int error_code = 'S' << 24 | 'T' << 16 | 'D' << 8;
     23  extern void open_dev_console(void);
    2524
    26   /*
    27    * Attempt to open /dev/console.
    28    */
    29   if ((stdin_fd = open("/dev/console", O_RDONLY, 0)) == -1) {
    30     /*
    31      * There may not be a console driver so this is OK.
    32      */
    33     return;
    34   }
    35 
    36   /*
    37    *  But if we find /dev/console once, we better find it twice more
    38    *  or something is REALLY wrong.
    39    */
    40   if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1)
    41     rtems_fatal_error_occurred( error_code | '1' );
    42 
    43   if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1)
    44     rtems_fatal_error_occurred( error_code | '2' );
     25  open_dev_console();
    4526}
Note: See TracChangeset for help on using the changeset viewer.