From: 独孤昊天 Date: Mon, 18 Dec 2017 06:52:25 +0000 (+0800) Subject: [monitor] wrong statement of break X-Git-Tag: lxc-2.0.10~460 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddbb1dbc0ce9cdd47f7306b279b59f59606e6955;p=thirdparty%2Flxc.git [monitor] wrong statement of break if lxc_abstract_unix_connect fail and return -1, this code never goto retry. Signed-off-by: liuhao --- diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 57722ae08..4b57bb727 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);