diff options
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 14 | ||||
-rw-r--r-- | cpukit/libcsupport/src/read.c | 5 | ||||
-rw-r--r-- | cpukit/libcsupport/src/write.c | 7 |
3 files changed, 14 insertions, 12 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 85f9c8e0a5..9bd8a8979c 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -871,13 +871,6 @@ static inline ssize_t rtems_libio_iovec_eval( int v; rtems_libio_t *iop; - rtems_libio_check_fd( fd ); - iop = rtems_libio_iop( fd ); - rtems_libio_check_is_open( iop ); - rtems_libio_check_permissions_with_error( iop, flags, EBADF ); - - *iopp = iop; - /* * Argument validation on IO vector */ @@ -910,6 +903,13 @@ static inline ssize_t rtems_libio_iovec_eval( } } + rtems_libio_check_fd( fd ); + iop = rtems_libio_iop( fd ); + rtems_libio_check_is_open( iop ); + rtems_libio_check_permissions_with_error( iop, flags, EBADF ); + + *iopp = iop; + return total; } diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c index a5df6a1140..dd3f0c7128 100644 --- a/cpukit/libcsupport/src/read.c +++ b/cpukit/libcsupport/src/read.c @@ -32,11 +32,12 @@ ssize_t read( { rtems_libio_t *iop; + rtems_libio_check_buffer( buffer ); + rtems_libio_check_count( count ); + rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); - rtems_libio_check_buffer( buffer ); - rtems_libio_check_count( count ); rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF ); /* diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c index c0119a54e4..8beea6494a 100644 --- a/cpukit/libcsupport/src/write.c +++ b/cpukit/libcsupport/src/write.c @@ -33,13 +33,14 @@ ssize_t write( size_t count ) { - rtems_libio_t *iop; + rtems_libio_t *iop; + + rtems_libio_check_buffer( buffer ); + rtems_libio_check_count( count ); rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open( iop ); - rtems_libio_check_buffer( buffer ); - rtems_libio_check_count( count ); rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF ); /* |