The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2048

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
if lxc_abstract_unix_connect fail and return -1,  this code never goto retry.
From 28818cb2949b3b6bffe5be0c550bc9998fbfe983 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8B=AC=E5=AD=A4=E6=98=8A=E5=A4=A9?=
 <duguhaot...@users.noreply.github.com>
Date: Mon, 18 Dec 2017 14:52:25 +0800
Subject: [PATCH] [monitor] wrong statement of break

if lxc_abstract_unix_connect fail and return -1,  this code never goto retry.
---
 src/lxc/monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c
index a16238992..6dcdd340d 100644
--- a/src/lxc/monitor.c
+++ b/src/lxc/monitor.c
@@ -232,7 +232,7 @@ int lxc_monitor_open(const char *lxcpath)
 
        for (retry = 0; retry < sizeof(backoff_ms) / sizeof(backoff_ms[0]); 
retry++) {
                fd = lxc_abstract_unix_connect(addr.sun_path);
-               if (fd < 0 || errno != ECONNREFUSED)
+               if (fd != -1 || errno != ECONNREFUSED)
                        break;
                ERROR("Failed to connect to monitor socket. Retrying in %d ms: 
%s", backoff_ms[retry], strerror(errno));
                usleep(backoff_ms[retry] * 1000);
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to