summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-13 13:30:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-15 10:27:12 +0200
commite2b1db231196e0c395d0e19d9b35c0d7da2a5d3e (patch)
treefea75571834f5a92d667df159c9444ae9231d4e1 /cpukit/libcsupport
parentlibio: Add rtems_libio_iop_flags_initialize() (diff)
downloadrtems-e2b1db231196e0c395d0e19d9b35c0d7da2a5d3e.tar.bz2
libio: Add rtems_libio_iop_flags()
Update #3132.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/include/rtems/libio.h5
-rw-r--r--cpukit/libcsupport/src/fcntl.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h
index 99d1565bef..96d0c29d1e 100644
--- a/cpukit/libcsupport/include/rtems/libio.h
+++ b/cpukit/libcsupport/include/rtems/libio.h
@@ -1374,6 +1374,11 @@ typedef struct {
/** @} */
+static inline uint32_t rtems_libio_iop_flags( const rtems_libio_t *iop )
+{
+ return iop->flags;
+}
+
/**
* @name External I/O Handlers
*/
diff --git a/cpukit/libcsupport/src/fcntl.c b/cpukit/libcsupport/src/fcntl.c
index 82052011ec..d44d4a0c1e 100644
--- a/cpukit/libcsupport/src/fcntl.c
+++ b/cpukit/libcsupport/src/fcntl.c
@@ -30,7 +30,7 @@ static int duplicate_iop( rtems_libio_t *iop )
int oflag;
rtems_libio_t *diop;
- oflag = rtems_libio_to_fcntl_flags( iop->flags );
+ oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
diop = rtems_libio_allocate();
if (diop != NULL) {
@@ -72,12 +72,12 @@ static int duplicate2_iop( rtems_libio_t *iop, int fd2 )
{
int oflag;
- if ((iop2->flags & LIBIO_FLAGS_OPEN) != 0) {
+ if ((rtems_libio_iop_flags( iop2 ) & LIBIO_FLAGS_OPEN) != 0) {
rv = (*iop2->pathinfo.handlers->close_h)( iop2 );
}
if (rv == 0) {
- oflag = rtems_libio_to_fcntl_flags( iop->flags );
+ oflag = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
rtems_libio_iop_flags_set( iop2, rtems_libio_fcntl_flags( oflag ) );
rtems_filesystem_instance_lock( &iop->pathinfo );
@@ -135,7 +135,7 @@ static int vfcntl(
break;
case F_GETFD: /* get f_flags */
- ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
+ ret = ((rtems_libio_iop_flags(iop) & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
break;
case F_SETFD: /* set f_flags */
@@ -154,7 +154,7 @@ static int vfcntl(
break;
case F_GETFL: /* more flags (cloexec) */
- ret = rtems_libio_to_fcntl_flags( iop->flags );
+ ret = rtems_libio_to_fcntl_flags( rtems_libio_iop_flags( iop ) );
break;
case F_SETFL: