diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/src/fdatasync.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cpukit/libcsupport/src/fdatasync.c b/cpukit/libcsupport/src/fdatasync.c index 58a4c4e118..91bff3aaba 100644 --- a/cpukit/libcsupport/src/fdatasync.c +++ b/cpukit/libcsupport/src/fdatasync.c @@ -22,22 +22,22 @@ int fdatasync( { rtems_libio_t *iop; + rtems_libio_check_fd( fd ); + iop = rtems_libio_iop( fd ); + rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); + /* * If this file descriptor is mapped to an external set of handlers, * then pass the request on to them. */ - if ( rtems_file_descriptor_type( fd ) ) + if ( iop->flags & LIBIO_FLAGS_HANDLER_MASK ) set_errno_and_return_minus_one( EBADF ); /* * Now process the fdatasync(). */ - iop = rtems_libio_iop( fd ); - rtems_libio_check_fd( fd ); - rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - if ( !iop->handlers->fdatasync ) set_errno_and_return_minus_one( ENOTSUP ); |