From a37e0b4deb596c42a07fd67cacaa3b66f9cad7bb Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Wed, 22 Oct 2003 17:56:09 +0000
Subject: [PATCH] Change test from > to >= to avoid connect retries if
 PORT_RETRIES parameter is zero.

---
 src/common/slurm_protocol_socket_implementation.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c
index 1d725c0941a..f5384f0819d 100644
--- a/src/common/slurm_protocol_socket_implementation.c
+++ b/src/common/slurm_protocol_socket_implementation.c
@@ -448,7 +448,7 @@ slurm_fd _slurm_open_stream(slurm_addr *addr)
                 rc = _slurm_connect(fd, (struct sockaddr const *)addr, sizeof(*addr));
                 if (rc >= 0)                    /* success */
                         break;
-                if ((errno != ECONNREFUSED) || (retry > PORT_RETRIES))
+                if ((errno != ECONNREFUSED) || (retry >= PORT_RETRIES))
                         goto error;
 
                 if ((_slurm_close_stream(fd) < 0) && (errno == EINTR))
-- 
GitLab