Harald Welte has submitted this change and it was merged.

Change subject: stream.c: osmo_stream_cli_open2: Remove wrong assumption in 
reconnect decision
......................................................................


stream.c: osmo_stream_cli_open2: Remove wrong assumption in reconnect decision

Documentation of osmo_sock_init2 doesn't provide information of any
specific value of errno set/expected after running the function. It is
incorrect to expect a specific value of errno and looking at the
implementation it is actually not a good idea to check it.

If reconnect flag is set, let's reconnect always instead of looking at
errno to decide.

Change-Id: I25b33f4cdc496ae31ff240d445b9b2805091845c
---
M src/stream.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/stream.c b/src/stream.c
index 78dafd5..9dcb94b 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -453,7 +453,7 @@
                              cli->addr, cli->port,
                              OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND);
        if (ret < 0) {
-               if (reconnect && errno == ECONNREFUSED)
+               if (reconnect)
                        osmo_stream_cli_reconnect(cli);
                return ret;
        }

-- 
To view, visit https://gerrit.osmocom.org/7650
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I25b33f4cdc496ae31ff240d445b9b2805091845c
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>

Reply via email to