Networking: Correct the value returned by accept() in the case where net_lockingwait() is called. It was returning -1 and losing the errno value. Noted by Rony Xln

This commit is contained in:
Gregory Nutt
2015-01-22 06:51:31 -06:00
parent 1dd722f836
commit 6175e9eec5
3 changed files with 39 additions and 9 deletions
+9 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* net/utils/net_lock.c
*
* Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -178,6 +178,14 @@ void net_unlock(net_lock_t flags)
* Description:
* Atomically wait for sem while temporarily releasing g_netlock.
*
* Input Parameters:
* sem - A reference to the semaphore to be taken.
*
* Returned value:
* The returned value is the same as sem_wait(): Zero (OK) is returned
* on success; -1 (ERROR) is returned on a failure with the errno value
* set appropriately.
*
****************************************************************************/
int net_lockedwait(sem_t *sem)