mirror of
https://github.com/apache/nuttx.git
synced 2026-09-09 02:16:35 +00:00
net/local/local_connect.c: Initialize lc_result before giving lc_waitsem
This commit is contained in:
parent
a418b63e07
commit
656c20fd4a
1 changed files with 4 additions and 1 deletions
|
|
@ -184,6 +184,10 @@ static int inline local_stream_connect(FAR struct local_conn_s *client,
|
|||
|
||||
DEBUGASSERT(client->lc_outfile.f_inode != NULL);
|
||||
|
||||
/* Set the busy "result" before giving the semaphore. */
|
||||
|
||||
client->u.client.lc_result = -EBUSY;
|
||||
|
||||
/* Add ourself to the list of waiting connections and notify the server. */
|
||||
|
||||
dq_addlast(&client->lc_node, &server->u.server.lc_waiters);
|
||||
|
|
@ -199,7 +203,6 @@ static int inline local_stream_connect(FAR struct local_conn_s *client,
|
|||
|
||||
/* Wait for the server to accept the connections */
|
||||
|
||||
client->u.client.lc_result = -EBUSY;
|
||||
do
|
||||
{
|
||||
_local_semtake(&client->lc_waitsem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue