diff options
Diffstat (limited to 'cpukit/libcsupport/src/fchmod.c')
-rw-r--r-- | cpukit/libcsupport/src/fchmod.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpukit/libcsupport/src/fchmod.c b/cpukit/libcsupport/src/fchmod.c index a3ca4507ab..f202a30eb0 100644 --- a/cpukit/libcsupport/src/fchmod.c +++ b/cpukit/libcsupport/src/fchmod.c @@ -27,19 +27,20 @@ int fchmod( { rtems_libio_t *iop; + rtems_libio_check_fd( fd ); + iop = rtems_libio_iop( fd ); + /* * If this is not a file system based entity, it is an error. */ - if ( rtems_file_descriptor_type( fd ) ) + if ( iop->flags & LIBIO_FLAGS_HANDLER_MASK ) set_errno_and_return_minus_one( EBADF ); /* * Now process the fchmod(). */ - iop = rtems_libio_iop( fd ); - rtems_libio_check_fd( fd ); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); if ( !iop->handlers->fchmod ) |