mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-24 20:57:29 +08:00
2011-07-22 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1839/filesystem * libcsupport/include/rtems/libio_.h, libcsupport/src/fchdir.c, libcsupport/src/fdatasync.c, libcsupport/src/fpathconf.c, libcsupport/src/fsync.c, libcsupport/src/ftruncate.c, libcsupport/src/read.c, libcsupport/src/readv.c, libcsupport/src/write.c, libcsupport/src/writev.c: Some calls did not return proper status for permission errors or incorrectly permissions at all.
This commit is contained in:
@@ -123,19 +123,30 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* rtems_libio_check_permissions
|
||||
* rtems_libio_check_permissions_with_error
|
||||
*
|
||||
* Macro to check if a file descriptor is open for this operation.
|
||||
* On failure, return the user specified error.
|
||||
*/
|
||||
|
||||
#define rtems_libio_check_permissions(_iop, _flag) \
|
||||
#define rtems_libio_check_permissions_with_error(_iop, _flag, _errno) \
|
||||
do { \
|
||||
if (((_iop)->flags & (_flag)) == 0) { \
|
||||
rtems_set_errno_and_return_minus_one( EINVAL ); \
|
||||
rtems_set_errno_and_return_minus_one( _errno ); \
|
||||
return -1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* rtems_libio_check_permissions
|
||||
*
|
||||
* Macro to check if a file descriptor is open for this operation.
|
||||
* On failure, return EINVAL
|
||||
*/
|
||||
|
||||
#define rtems_libio_check_permissions(_iop, _flag) \
|
||||
rtems_libio_check_permissions_with_error(_iop, _flag, EINVAL )
|
||||
|
||||
/*
|
||||
* rtems_filesystem_freenode
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user