From c71c9516ddff9d5e724401b97e8f134f3b5f1867 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 5 Apr 2018 18:07:39 +0200 Subject: 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 --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/stream.c') 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 @@ int osmo_stream_cli_open2(struct osmo_stream_cli *cli, int reconnect) 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; } -- cgit v1.2.3