forked from Imagelibrary/rtems
@@ -1399,6 +1399,16 @@ static inline bool rtems_libio_iop_is_readable( const rtems_libio_t *iop )
|
||||
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_READ ) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns true if this is a writeable iop, otherwise returns false.
|
||||
*
|
||||
* @param[in] iop The iop.
|
||||
*/
|
||||
static inline bool rtems_libio_iop_is_writeable( const rtems_libio_t *iop )
|
||||
{
|
||||
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_WRITE ) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @name External I/O Handlers
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ static int IMFS_linfile_open(
|
||||
/*
|
||||
* Perform 'copy on write' for linear files
|
||||
*/
|
||||
if ((iop->flags & LIBIO_FLAGS_WRITE) != 0) {
|
||||
if (rtems_libio_iop_is_writeable(iop)) {
|
||||
uint32_t count = file->File.size;
|
||||
const unsigned char *buffer = file->Linearfile.direct;
|
||||
|
||||
|
||||
@@ -1032,11 +1032,11 @@ static int rtems_ftpfs_open(
|
||||
bool verbose = me->verbose;
|
||||
const struct timeval *timeout = &me->timeout;
|
||||
|
||||
e->write = (iop->flags & LIBIO_FLAGS_WRITE) != 0;
|
||||
e->write = rtems_libio_iop_is_writeable(iop);
|
||||
|
||||
/* Check for either read-only or write-only flags */
|
||||
if (
|
||||
(iop->flags & LIBIO_FLAGS_WRITE) != 0
|
||||
rtems_libio_iop_is_writeable(iop)
|
||||
&& rtems_libio_iop_is_readable(iop)
|
||||
) {
|
||||
eno = ENOTSUP;
|
||||
|
||||
Reference in New Issue
Block a user