summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/chown.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-09-11 10:59:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-09-12 15:31:23 +0200
commitd2da61aa0cf73dadc31eb3fd4202c04faf0e7653 (patch)
tree65156db0a2ec463e6a7f2752e3e7c8463f2bc35b /cpukit/libcsupport/src/chown.c
parentFilesystem: Add and use rtems_filesystem_chmod() (diff)
downloadrtems-d2da61aa0cf73dadc31eb3fd4202c04faf0e7653.tar.bz2
Filesystem: Change rtems_filesystem_chown()
Implement POSIX requirements in the high-level file system layer. Use common implementation for all change owner variants.
Diffstat (limited to 'cpukit/libcsupport/src/chown.c')
-rw-r--r--cpukit/libcsupport/src/chown.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/cpukit/libcsupport/src/chown.c b/cpukit/libcsupport/src/chown.c
index 434fc2b1a2..08ad8a26cc 100644
--- a/cpukit/libcsupport/src/chown.c
+++ b/cpukit/libcsupport/src/chown.c
@@ -25,31 +25,20 @@
#include <rtems/libio_.h>
-int rtems_filesystem_chown(
- const char *path,
- uid_t owner,
- gid_t group,
- int eval_follow_link
-)
+/**
+ * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
+ */
+int chown( const char *path, uid_t owner, gid_t group )
{
- int rv = 0;
+ int rv;
rtems_filesystem_eval_path_context_t ctx;
- int eval_flags = eval_follow_link;
+ int eval_flags = RTEMS_FS_FOLLOW_LINK;
const rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
- const rtems_filesystem_operations_table *ops = currentloc->mt_entry->ops;
- rv = (*ops->chown_h)( currentloc, owner, group );
+ rv = rtems_filesystem_chown( currentloc, owner, group );
rtems_filesystem_eval_path_cleanup( &ctx );
return rv;
}
-
-/**
- * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
- */
-int chown( const char *path, uid_t owner, gid_t group )
-{
- return rtems_filesystem_chown( path, owner, group, RTEMS_FS_FOLLOW_LINK );
-}