forked from Imagelibrary/rtems
@@ -255,7 +255,7 @@ rtems_device_driver console_open(
|
||||
}
|
||||
}
|
||||
|
||||
if ( (args->iop->flags&LIBIO_FLAGS_READ) &&
|
||||
if (rtems_libio_iop_is_readable(args->iop) &&
|
||||
cptr->pDeviceFlow &&
|
||||
cptr->pDeviceFlow->deviceStartRemoteTx) {
|
||||
cptr->pDeviceFlow->deviceStartRemoteTx(minor);
|
||||
@@ -288,7 +288,7 @@ rtems_device_driver console_close(
|
||||
* Stop only if it's the last one opened.
|
||||
*/
|
||||
if ( (current_tty->refcount == 1) ) {
|
||||
if ( (args->iop->flags&LIBIO_FLAGS_READ) &&
|
||||
if (rtems_libio_iop_is_readable(args->iop) &&
|
||||
cptr->pDeviceFlow &&
|
||||
cptr->pDeviceFlow->deviceStopRemoteTx) {
|
||||
cptr->pDeviceFlow->deviceStopRemoteTx(minor);
|
||||
|
||||
@@ -1389,6 +1389,16 @@ static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop )
|
||||
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_NO_DELAY ) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns true if this is a readable iop, otherwise returns false.
|
||||
*
|
||||
* @param[in] iop The iop.
|
||||
*/
|
||||
static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop )
|
||||
{
|
||||
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_READ ) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name External I/O Handlers
|
||||
*/
|
||||
|
||||
@@ -1037,7 +1037,7 @@ static int rtems_ftpfs_open(
|
||||
/* Check for either read-only or write-only flags */
|
||||
if (
|
||||
(iop->flags & LIBIO_FLAGS_WRITE) != 0
|
||||
&& (iop->flags & LIBIO_FLAGS_READ) != 0
|
||||
&& rtems_libio_iop_is_readable(iop)
|
||||
) {
|
||||
eno = ENOTSUP;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user