mirror of
https://github.com/ChronosX88/netsukuku.git
synced 2024-11-22 18:22:18 +00:00
Properly release lock on error conditions
This commit is contained in:
parent
faed393afb
commit
9f5013fcde
@ -366,12 +366,15 @@ void *tcp_daemon(void *door)
|
|||||||
* While we are accepting the connections we keep the socket non
|
* While we are accepting the connections we keep the socket non
|
||||||
* blocking.
|
* blocking.
|
||||||
*/
|
*/
|
||||||
if(set_nonblock_sk(dev_sk[i]))
|
if(set_nonblock_sk(dev_sk[i])) {
|
||||||
return NULL;
|
pthread_mutex_unlock(&tcp_daemon_lock);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Shhh, it's listening... */
|
/* Shhh, it's listening... */
|
||||||
if(listen(dev_sk[i], 5) == -1) {
|
if(listen(dev_sk[i], 5) == -1) {
|
||||||
inet_close(&dev_sk[i]);
|
inet_close(&dev_sk[i]);
|
||||||
|
pthread_mutex_unlock(&tcp_daemon_lock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user