]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
[monitor] wrong statement of break
author独孤昊天 <duguhaotian@users.noreply.github.com>
Mon, 18 Dec 2017 06:52:25 +0000 (14:52 +0800)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 1 Jan 2018 23:36:19 +0000 (00:36 +0100)
if lxc_abstract_unix_connect fail and return -1,  this code never goto retry.

Signed-off-by: liuhao <liuhao27@huawei.com>
src/lxc/monitor.c

index 57722ae087da4ee6f03178ad155e0aec9288f060..4b57bb727e5de8c510283443a9c4a45ce6161a36 100644 (file)
@@ -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);