mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Extended the thread-safety locking to the file descriptors.
git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14844 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: unistd_fchown.c,v 1.6 2005-02-21 10:22:02 obarthel Exp $
|
||||
* $Id: unistd_fchown.c,v 1.7 2005-02-28 13:22:53 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -49,7 +49,7 @@ fchown(int file_descriptor, uid_t owner, gid_t group)
|
||||
BPTR old_current_dir = ZERO;
|
||||
BOOL current_dir_changed = FALSE;
|
||||
int result = -1;
|
||||
struct fd * fd;
|
||||
struct fd * fd = NULL;
|
||||
LONG success;
|
||||
|
||||
ENTER();
|
||||
@ -72,6 +72,8 @@ fchown(int file_descriptor, uid_t owner, gid_t group)
|
||||
goto out;
|
||||
}
|
||||
|
||||
__fd_lock(fd);
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_IS_SOCKET))
|
||||
{
|
||||
__set_errno(EINVAL);
|
||||
@ -163,6 +165,8 @@ fchown(int file_descriptor, uid_t owner, gid_t group)
|
||||
|
||||
out:
|
||||
|
||||
__fd_unlock(fd);
|
||||
|
||||
PROFILE_OFF();
|
||||
|
||||
UnLock(parent_dir);
|
||||
|
||||
Reference in New Issue
Block a user