[PATCH 08/18] libio: rtems_libio_check_permissions_with_error()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Sep 13 13:39:41 UTC 2017


Rename rtems_libio_check_permissions_with_error() in
rtems_libio_check_permissions().

Update #3132.
---
 cpukit/libcsupport/include/rtems/libio_.h | 6 +++---
 cpukit/libcsupport/src/fdatasync.c        | 2 +-
 cpukit/libcsupport/src/ftruncate.c        | 2 +-
 cpukit/libcsupport/src/read.c             | 2 +-
 cpukit/libcsupport/src/write.c            | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index 0a80c917b7..ba6866e5a4 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -171,13 +171,13 @@ static inline rtems_libio_t *rtems_libio_iop( int fd )
   } while (0)
 
 /*
- *  rtems_libio_check_permissions_with_error
+ *  rtems_libio_check_permissions
  *
  *  Macro to check if a file descriptor is open for this operation.
  *  On failure, return the user specified error.
  */
 
-#define rtems_libio_check_permissions_with_error(_iop, _flag, _errno) \
+#define rtems_libio_check_permissions(_iop, _flag, _errno) \
   do {                                                      \
       if (((_iop)->flags & (_flag)) == 0) {                 \
             rtems_set_errno_and_return_minus_one( _errno ); \
@@ -896,7 +896,7 @@ static inline ssize_t rtems_libio_iovec_eval(
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open( iop );
-  rtems_libio_check_permissions_with_error( iop, flags, EBADF );
+  rtems_libio_check_permissions( iop, flags, EBADF );
 
   *iopp = iop;
 
diff --git a/cpukit/libcsupport/src/fdatasync.c b/cpukit/libcsupport/src/fdatasync.c
index 32235237af..a5191c3b04 100644
--- a/cpukit/libcsupport/src/fdatasync.c
+++ b/cpukit/libcsupport/src/fdatasync.c
@@ -32,7 +32,7 @@ int fdatasync(
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open(iop);
-  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
+  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE, EBADF );
 
   /*
    *  Now process the fdatasync().
diff --git a/cpukit/libcsupport/src/ftruncate.c b/cpukit/libcsupport/src/ftruncate.c
index 4a194066e5..64c2dc0045 100644
--- a/cpukit/libcsupport/src/ftruncate.c
+++ b/cpukit/libcsupport/src/ftruncate.c
@@ -32,7 +32,7 @@ int ftruncate( int fd, off_t length )
     rtems_libio_check_fd( fd );
     iop = rtems_libio_iop( fd );
     rtems_libio_check_is_open( iop );
-    rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EINVAL );
+    rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE, EINVAL );
 
     rv = (*iop->pathinfo.handlers->ftruncate_h)( iop, length );
   } else {
diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c
index dd3f0c7128..60c50eb875 100644
--- a/cpukit/libcsupport/src/read.c
+++ b/cpukit/libcsupport/src/read.c
@@ -38,7 +38,7 @@ ssize_t read(
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open( iop );
-  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
+  rtems_libio_check_permissions( iop, LIBIO_FLAGS_READ, EBADF );
 
   /*
    *  Now process the read().
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c
index 8beea6494a..e98fb18a26 100644
--- a/cpukit/libcsupport/src/write.c
+++ b/cpukit/libcsupport/src/write.c
@@ -41,7 +41,7 @@ ssize_t write(
   rtems_libio_check_fd( fd );
   iop = rtems_libio_iop( fd );
   rtems_libio_check_is_open( iop );
-  rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
+  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE, EBADF );
 
   /*
    *  Now process the write() request.
-- 
2.12.3




More information about the devel mailing list