diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-13 08:55:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-15 07:33:43 +0200 |
commit | 0169e90e8488b1af029486e7215600c87a014fa3 (patch) | |
tree | 0998a30e8a4c452cea2a20a45815d106229b3aeb /cpukit/libcsupport/include/rtems/libio_.h | |
parent | libio: Avoid direct use of rtems_libio_iops (diff) | |
download | rtems-0169e90e8488b1af029486e7215600c87a014fa3.tar.bz2 |
libio: Do simple parameter checks early
This simplifies error handling later.
Update #3132.
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libio_.h')
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio_.h | 14 |
1 files changed, 7 insertions, 7 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; } |