diff options
Diffstat (limited to 'c/src/lib/libc/fcntl.c')
-rw-r--r-- | c/src/lib/libc/fcntl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/c/src/lib/libc/fcntl.c b/c/src/lib/libc/fcntl.c index a538ec1cf9..b327a447ac 100644 --- a/c/src/lib/libc/fcntl.c +++ b/c/src/lib/libc/fcntl.c @@ -32,20 +32,20 @@ int fcntl( va_start( ap, cmd ); + 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 fcntl(). */ - iop = rtems_libio_iop( fd ); - rtems_libio_check_fd( fd ); - /* * This switch should contain all the cases from POSIX. */ |