forked from Imagelibrary/rtems
2001-04-20 Joel Sherrill <joel@OARcorp.com>
* 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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-04-20 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2001-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2001-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* monitor/mon-command.c: Use #if defined(RTEMS_UNIX).
|
* monitor/mon-command.c: Use #if defined(RTEMS_UNIX).
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_unsigned32 NULL_major;
|
rtems_unsigned32 NULL_major;
|
||||||
|
static initialized;
|
||||||
|
|
||||||
rtems_device_driver null_initialize(
|
rtems_device_driver null_initialize(
|
||||||
rtems_device_major_number major,
|
rtems_device_major_number major,
|
||||||
@@ -39,7 +40,10 @@ rtems_device_driver null_initialize(
|
|||||||
void *pargp
|
void *pargp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_device_driver status ;
|
rtems_device_driver status;
|
||||||
|
|
||||||
|
if ( !initialized ) {
|
||||||
|
initialized = 1;
|
||||||
|
|
||||||
status = rtems_io_register_name(
|
status = rtems_io_register_name(
|
||||||
"/dev/null",
|
"/dev/null",
|
||||||
@@ -51,6 +55,7 @@ rtems_device_driver null_initialize(
|
|||||||
rtems_fatal_error_occurred(status);
|
rtems_fatal_error_occurred(status);
|
||||||
|
|
||||||
NULL_major = major;
|
NULL_major = major;
|
||||||
|
}
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
@@ -143,9 +148,10 @@ rtems_device_driver null_write(
|
|||||||
void *pargp
|
void *pargp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp ;
|
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
|
||||||
|
|
||||||
rw_args->bytes_moved = rw_args->count ;
|
if ( rw_args )
|
||||||
|
rw_args->bytes_moved = rw_args->count;
|
||||||
|
|
||||||
return NULL_SUCCESSFUL;
|
return NULL_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
2001-04-20 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2001-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
2001-02-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* monitor/mon-command.c: Use #if defined(RTEMS_UNIX).
|
* monitor/mon-command.c: Use #if defined(RTEMS_UNIX).
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
rtems_unsigned32 NULL_major;
|
rtems_unsigned32 NULL_major;
|
||||||
|
static initialized;
|
||||||
|
|
||||||
rtems_device_driver null_initialize(
|
rtems_device_driver null_initialize(
|
||||||
rtems_device_major_number major,
|
rtems_device_major_number major,
|
||||||
@@ -39,7 +40,10 @@ rtems_device_driver null_initialize(
|
|||||||
void *pargp
|
void *pargp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_device_driver status ;
|
rtems_device_driver status;
|
||||||
|
|
||||||
|
if ( !initialized ) {
|
||||||
|
initialized = 1;
|
||||||
|
|
||||||
status = rtems_io_register_name(
|
status = rtems_io_register_name(
|
||||||
"/dev/null",
|
"/dev/null",
|
||||||
@@ -51,6 +55,7 @@ rtems_device_driver null_initialize(
|
|||||||
rtems_fatal_error_occurred(status);
|
rtems_fatal_error_occurred(status);
|
||||||
|
|
||||||
NULL_major = major;
|
NULL_major = major;
|
||||||
|
}
|
||||||
|
|
||||||
return RTEMS_SUCCESSFUL;
|
return RTEMS_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
@@ -143,9 +148,10 @@ rtems_device_driver null_write(
|
|||||||
void *pargp
|
void *pargp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp ;
|
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
|
||||||
|
|
||||||
rw_args->bytes_moved = rw_args->count ;
|
if ( rw_args )
|
||||||
|
rw_args->bytes_moved = rw_args->count;
|
||||||
|
|
||||||
return NULL_SUCCESSFUL;
|
return NULL_SUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user