Cygwin: AF_UNIX: Add state_lock to guard manipulating shared state info

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2018-03-18 20:06:43 +01:00
parent 60ca1c1359
commit 848d5b70db
2 changed files with 9 additions and 0 deletions

View File

@ -1225,8 +1225,10 @@ out:
if (param)
cfree (param);
conn_lock ();
state_lock ();
so_error (error);
connect_state (error ? connect_failed : connected);
state_unlock ();
conn_unlock ();
return error;
}
@ -1688,12 +1690,14 @@ fhandler_socket_unix::getpeereid (pid_t *pid, uid_t *euid, gid_t *egid)
{
__try
{
state_lock ();
if (pid)
*pid = peer_cred.pid;
if (euid)
*euid = peer_cred.uid;
if (egid)
*egid = peer_cred.gid;
state_unlock ();
ret = 0;
}
__except (EFAULT) {}