Changeset eecf752 in rtems


Ignore:
Timestamp:
Nov 9, 2009, 3:19:57 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
f20ea02f
Parents:
0610d21e
Message:

2009-11-09 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/open_dev_console.c: Use constant numbers to avoid overflow when shifting on 16-bit targets.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r0610d21e reecf752  
     12009-11-09      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/src/open_dev_console.c: Use constant numbers to avoid
     4        overflow when shifting on 16-bit targets.
     5
    162009-11-09      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/libcsupport/src/open_dev_console.c

    r0610d21e reecf752  
    22 *  open_dev_console - open /dev/console
    33 *
    4  *  COPYRIGHT (c) 1989-2007.
     4 *  COPYRIGHT (c) 1989-2009.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    2121
    2222/*
    23  *  This is a replaceable stub
     23 *  This is a replaceable stub which opens the console, if present.
    2424 */
    25 
    2625void open_dev_console(void)
    2726{
    28   int stdin_fd, stdout_fd, stderr_fd;
    29   int error_code = 'S' << 24 | 'T' << 16 | 'D' << 8;
     27  int      stdin_fd;
     28  int      stdout_fd;
     29  int      stderr_fd;
    3030
    3131  /*
     
    4444   */
    4545  if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1)
    46     rtems_fatal_error_occurred( error_code | '1' );
     46    rtems_fatal_error_occurred( 0x55544431 );  /* error STD1 */
    4747
    4848  if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1)
    49     rtems_fatal_error_occurred( error_code | '2' );
     49    rtems_fatal_error_occurred( 0x55544432 );  /* error STD2 */
    5050}
    5151
Note: See TracChangeset for help on using the changeset viewer.