Changeset a5bdcd9 in rtems


Ignore:
Timestamp:
Apr 20, 2001, 1:37:05 PM (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
80526fa
Parents:
53462762
Message:

2001-04-20 Joel Sherrill <joel@…>

  • devnull/devnull.c (null_initialize): Added check to ensure that the driver is only initialized once. Otherwise, it will abort when the device /dev/null is present. (null_write): Do not dereference a NULL pointer.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/libmisc/ChangeLog

    r53462762 ra5bdcd9  
     12001-04-20      Joel Sherrill <joel@OARcorp.com>
     2
     3        * devnull/devnull.c (null_initialize): Added check to
     4        ensure that the driver is only initialized once.  Otherwise,
     5        it will abort when the device /dev/null is present.
     6        (null_write): Do not dereference a NULL pointer.
     7
    182001-02-06      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    29
  • c/src/libmisc/devnull/devnull.c

    r53462762 ra5bdcd9  
    3333
    3434rtems_unsigned32 NULL_major;
     35static initialized;
    3536
    3637rtems_device_driver null_initialize(
     
    4041)
    4142{
    42   rtems_device_driver status ;
     43  rtems_device_driver status;
    4344 
    44   status = rtems_io_register_name(
    45     "/dev/null",
    46     major,
    47     (rtems_device_minor_number) 0
     45  if ( !initialized ) {
     46    initialized = 1;
     47
     48    status = rtems_io_register_name(
     49      "/dev/null",
     50      major,
     51      (rtems_device_minor_number) 0
    4852    );
    4953
    50   if (status != RTEMS_SUCCESSFUL)
    51     rtems_fatal_error_occurred(status);
     54    if (status != RTEMS_SUCCESSFUL)
     55      rtems_fatal_error_occurred(status);
    5256     
    53   NULL_major = major;
     57    NULL_major = major;
     58  }
    5459 
    5560  return RTEMS_SUCCESSFUL;
     
    144149)
    145150{
    146   rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp ;
     151  rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
    147152 
    148   rw_args->bytes_moved = rw_args->count ;
     153  if ( rw_args )
     154    rw_args->bytes_moved = rw_args->count;
    149155 
    150156  return NULL_SUCCESSFUL;
  • cpukit/libmisc/ChangeLog

    r53462762 ra5bdcd9  
     12001-04-20      Joel Sherrill <joel@OARcorp.com>
     2
     3        * devnull/devnull.c (null_initialize): Added check to
     4        ensure that the driver is only initialized once.  Otherwise,
     5        it will abort when the device /dev/null is present.
     6        (null_write): Do not dereference a NULL pointer.
     7
    182001-02-06      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    29
  • cpukit/libmisc/devnull/devnull.c

    r53462762 ra5bdcd9  
    3333
    3434rtems_unsigned32 NULL_major;
     35static initialized;
    3536
    3637rtems_device_driver null_initialize(
     
    4041)
    4142{
    42   rtems_device_driver status ;
     43  rtems_device_driver status;
    4344 
    44   status = rtems_io_register_name(
    45     "/dev/null",
    46     major,
    47     (rtems_device_minor_number) 0
     45  if ( !initialized ) {
     46    initialized = 1;
     47
     48    status = rtems_io_register_name(
     49      "/dev/null",
     50      major,
     51      (rtems_device_minor_number) 0
    4852    );
    4953
    50   if (status != RTEMS_SUCCESSFUL)
    51     rtems_fatal_error_occurred(status);
     54    if (status != RTEMS_SUCCESSFUL)
     55      rtems_fatal_error_occurred(status);
    5256     
    53   NULL_major = major;
     57    NULL_major = major;
     58  }
    5459 
    5560  return RTEMS_SUCCESSFUL;
     
    144149)
    145150{
    146   rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp ;
     151  rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
    147152 
    148   rw_args->bytes_moved = rw_args->count ;
     153  if ( rw_args )
     154    rw_args->bytes_moved = rw_args->count;
    149155 
    150156  return NULL_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.