diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-13 10:11:46 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-15 07:48:03 +0200 |
commit | 856ede4f91a76a1a681ceac24ddb18d3a438dffb (patch) | |
tree | 969faa830fdcc9815a4335567e10b4f949e7e942 /cpukit/libcsupport/src | |
parent | libio: rtems_libio_check_permissions_with_error() (diff) | |
download | rtems-856ede4f91a76a1a681ceac24ddb18d3a438dffb.tar.bz2 |
libio: Add iop set/clear flags
Update #3132.
Diffstat (limited to '')
-rw-r--r-- | cpukit/libcsupport/src/close.c | 2 | ||||
-rw-r--r-- | cpukit/libcsupport/src/fcntl.c | 11 | ||||
-rw-r--r-- | cpukit/libcsupport/src/open.c | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/close.c b/cpukit/libcsupport/src/close.c index 139ffd266a..649107dff0 100644 --- a/cpukit/libcsupport/src/close.c +++ b/cpukit/libcsupport/src/close.c @@ -31,7 +31,7 @@ int close( iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); - iop->flags &= ~LIBIO_FLAGS_OPEN; + rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_OPEN ); rc = (*iop->pathinfo.handlers->close_h)( iop ); diff --git a/cpukit/libcsupport/src/fcntl.c b/cpukit/libcsupport/src/fcntl.c index e7a9868980..0fe734d61c 100644 --- a/cpukit/libcsupport/src/fcntl.c +++ b/cpukit/libcsupport/src/fcntl.c @@ -33,7 +33,7 @@ static int duplicate_iop( rtems_libio_t *iop ) if (diop != NULL) { int oflag = rtems_libio_to_fcntl_flags( iop->flags ); - diop->flags |= rtems_libio_fcntl_flags( oflag ); + rtems_libio_iop_flags_set( diop, rtems_libio_fcntl_flags( oflag ) ); rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); @@ -75,7 +75,7 @@ static int duplicate2_iop( rtems_libio_t *iop, int fd2 ) if (rv == 0) { oflag = rtems_libio_to_fcntl_flags( iop->flags ); - iop2->flags |= rtems_libio_fcntl_flags( oflag ); + rtems_libio_iop_flags_set( iop2, rtems_libio_fcntl_flags( oflag ) ); rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &iop2->pathinfo, &iop->pathinfo ); @@ -145,9 +145,9 @@ static int vfcntl( */ if ( va_arg( ap, int ) ) - iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; + rtems_libio_iop_flags_set( iop, LIBIO_FLAGS_CLOSE_ON_EXEC ); else - iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; + rtems_libio_iop_flags_clear( iop, LIBIO_FLAGS_CLOSE_ON_EXEC ); break; case F_GETFL: /* more flags (cloexec) */ @@ -162,7 +162,8 @@ static int vfcntl( * XXX If we are turning on append, should we seek to the end? */ - iop->flags = (iop->flags & ~mask) | (flags & mask); + rtems_libio_iop_flags_clear( iop, mask ); + rtems_libio_iop_flags_set( iop, flags & mask ); break; case F_GETLK: diff --git a/cpukit/libcsupport/src/open.c b/cpukit/libcsupport/src/open.c index 62ce507284..2ee99f1f4c 100644 --- a/cpukit/libcsupport/src/open.c +++ b/cpukit/libcsupport/src/open.c @@ -96,7 +96,7 @@ static int do_open( } } - iop->flags |= rtems_libio_fcntl_flags( oflag ); + rtems_libio_iop_flags_set( iop, rtems_libio_fcntl_flags( oflag ) ); rtems_filesystem_eval_path_extract_currentloc( &ctx, &iop->pathinfo ); rtems_filesystem_eval_path_cleanup( &ctx ); |