From cca44008d81209e9fa992157637d9de0384e0536 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 10 Dec 1998 23:31:54 +0000 Subject: Merged Eric Norum's select patch that was based on 4.0 and resolved all conflicts. --- c/src/lib/libc/fchmod.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'c/src/lib/libc/fchmod.c') diff --git a/c/src/lib/libc/fchmod.c b/c/src/lib/libc/fchmod.c index a3ca4507ab..f202a30eb0 100644 --- a/c/src/lib/libc/fchmod.c +++ b/c/src/lib/libc/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 ) -- cgit v1.2.3