diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-11-09 15:19:57 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-11-09 15:19:57 +0000 |
commit | eecf752dc3328897ca6bae004d467b1840419786 (patch) | |
tree | 4f31191a854054c525d9905cde2f56599b6f8b95 /cpukit/libcsupport | |
parent | 2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-eecf752dc3328897ca6bae004d467b1840419786.tar.bz2 |
2009-11-09 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/open_dev_console.c: Use constant numbers to avoid
overflow when shifting on 16-bit targets.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r-- | cpukit/libcsupport/src/open_dev_console.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/open_dev_console.c b/cpukit/libcsupport/src/open_dev_console.c index 4606c1f15f..3247bf3d36 100644 --- a/cpukit/libcsupport/src/open_dev_console.c +++ b/cpukit/libcsupport/src/open_dev_console.c @@ -1,7 +1,7 @@ /* * open_dev_console - open /dev/console * - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -20,13 +20,13 @@ #include <fcntl.h> /* - * This is a replaceable stub + * This is a replaceable stub which opens the console, if present. */ - void open_dev_console(void) { - int stdin_fd, stdout_fd, stderr_fd; - int error_code = 'S' << 24 | 'T' << 16 | 'D' << 8; + int stdin_fd; + int stdout_fd; + int stderr_fd; /* * Attempt to open /dev/console. @@ -43,9 +43,9 @@ void open_dev_console(void) * or something is REALLY wrong. */ if ((stdout_fd = open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred( error_code | '1' ); + rtems_fatal_error_occurred( 0x55544431 ); /* error STD1 */ if ((stderr_fd = open("/dev/console", O_WRONLY, 0)) == -1) - rtems_fatal_error_occurred( error_code | '2' ); + rtems_fatal_error_occurred( 0x55544432 ); /* error STD2 */ } |