From 4c163cf43baf965a2998e7f89dbaeefb09c3c47e Mon Sep 17 00:00:00 2001 From: Roland Takacs Date: Mon, 19 Jun 2017 12:18:05 +0200 Subject: [PATCH] Throw error when error happens in the tcp_listen function --- net/socket/listen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/socket/listen.c b/net/socket/listen.c index b05d18aceb..6c39f19b6d 100644 --- a/net/socket/listen.c +++ b/net/socket/listen.c @@ -151,7 +151,13 @@ int psock_listen(FAR struct socket *psock, int backlog) * accept() is called and enables poll()/select() logic. */ - tcp_listen(conn); + errcode = tcp_listen(conn); + + if (errcode < 0) + { + errcode = -errcode; + goto errout; + } #else errcode = EOPNOTSUPP; goto errout;