forked from Imagelibrary/rtems
Added asserts for unhandled conditions which need to result in error
statuses being returned to gnat runtime in order for it to raise use_errors. This was needed to identify the places in gnat's runtime which needed to be addressed.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <stdio.h> /* O_RDONLY, et.al. */
|
||||
#include <fcntl.h> /* O_RDONLY, et.al. */
|
||||
#include <assert.h>
|
||||
|
||||
#if ! defined(O_NDELAY)
|
||||
# if defined(solaris2)
|
||||
@@ -252,8 +253,13 @@ __open(
|
||||
rtems_driver_name_t *np;
|
||||
rtems_libio_open_close_args_t args;
|
||||
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) {
|
||||
if ( rc == RTEMS_UNSATISFIED ) {
|
||||
puts( "open -- ENOSYS case" );
|
||||
assert( 0 );
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
iop = rtems_libio_allocate();
|
||||
if (iop == 0)
|
||||
@@ -273,6 +279,7 @@ __open(
|
||||
rc = rtems_io_open(np->major, np->minor, (void *) &args);
|
||||
|
||||
done:
|
||||
|
||||
if (rc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
if (iop)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <stdio.h> /* O_RDONLY, et.al. */
|
||||
#include <fcntl.h> /* O_RDONLY, et.al. */
|
||||
#include <assert.h>
|
||||
|
||||
#if ! defined(O_NDELAY)
|
||||
# if defined(solaris2)
|
||||
@@ -252,8 +253,13 @@ __open(
|
||||
rtems_driver_name_t *np;
|
||||
rtems_libio_open_close_args_t args;
|
||||
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) {
|
||||
if ( rc == RTEMS_UNSATISFIED ) {
|
||||
puts( "open -- ENOSYS case" );
|
||||
assert( 0 );
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
iop = rtems_libio_allocate();
|
||||
if (iop == 0)
|
||||
@@ -273,6 +279,7 @@ __open(
|
||||
rc = rtems_io_open(np->major, np->minor, (void *) &args);
|
||||
|
||||
done:
|
||||
|
||||
if (rc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
if (iop)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <assert.h>
|
||||
|
||||
/*
|
||||
* fstat, stat, and isatty must lie consistently and report that everything
|
||||
@@ -30,6 +31,10 @@
|
||||
|
||||
int __fstat(int _fd, struct stat* _sbuf)
|
||||
{
|
||||
if ( _fd > 2 ) {
|
||||
puts( "__fstat -- only stdio supported" );
|
||||
assert( 0 );
|
||||
}
|
||||
_sbuf->st_mode = S_IFCHR;
|
||||
#ifdef HAVE_BLKSIZE
|
||||
_sbuf->st_blksize = 0;
|
||||
@@ -44,6 +49,10 @@ int __isatty(int _fd)
|
||||
|
||||
int stat( const char *path, struct stat *buf )
|
||||
{
|
||||
if ( strncmp( "/dev/", path, 5 ) ) {
|
||||
puts( "stat -- non-devices not supported" );
|
||||
assert( 0 );
|
||||
}
|
||||
return __fstat( 0, buf );
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <stdio.h> /* O_RDONLY, et.al. */
|
||||
#include <fcntl.h> /* O_RDONLY, et.al. */
|
||||
#include <assert.h>
|
||||
|
||||
#if ! defined(O_NDELAY)
|
||||
# if defined(solaris2)
|
||||
@@ -252,8 +253,13 @@ __open(
|
||||
rtems_driver_name_t *np;
|
||||
rtems_libio_open_close_args_t args;
|
||||
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL)
|
||||
if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) {
|
||||
if ( rc == RTEMS_UNSATISFIED ) {
|
||||
puts( "open -- ENOSYS case" );
|
||||
assert( 0 );
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
||||
iop = rtems_libio_allocate();
|
||||
if (iop == 0)
|
||||
@@ -273,6 +279,7 @@ __open(
|
||||
rc = rtems_io_open(np->major, np->minor, (void *) &args);
|
||||
|
||||
done:
|
||||
|
||||
if (rc != RTEMS_SUCCESSFUL)
|
||||
{
|
||||
if (iop)
|
||||
|
||||
Reference in New Issue
Block a user