diff options
Diffstat (limited to 'cpukit/libcsupport/src/fchown.c')
-rw-r--r-- | cpukit/libcsupport/src/fchown.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/cpukit/libcsupport/src/fchown.c b/cpukit/libcsupport/src/fchown.c index 13bb2b9da0..b5891bf36d 100644 --- a/cpukit/libcsupport/src/fchown.c +++ b/cpukit/libcsupport/src/fchown.c @@ -12,24 +12,16 @@ */ #if HAVE_CONFIG_H -#include "config.h" + #include "config.h" #endif -#include <sys/stat.h> -#include <errno.h> - -#include <rtems.h> -#include <rtems/libio.h> +#include <unistd.h> #include <rtems/libio_.h> -#include <rtems/seterr.h> -int fchown( - int fd, - uid_t owner, - gid_t group -) +int fchown( int fd, uid_t owner, gid_t group ) { + int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); @@ -38,5 +30,9 @@ int fchown( rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); - return (*iop->pathinfo.ops->chown_h)( &iop->pathinfo, owner, group ); + rtems_filesystem_instance_lock( &iop->pathinfo ); + rv = (*iop->pathinfo.ops->chown_h)( &iop->pathinfo, owner, group ); + rtems_filesystem_instance_unlock( &iop->pathinfo ); + + return rv; } |