]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
[monitor] wrong statement of break 2048/head
author独孤昊天 <duguhaotian@users.noreply.github.com>
Mon, 18 Dec 2017 06:52:25 +0000 (14:52 +0800)
committerliuhao <liuhao27@huawei.com>
Tue, 19 Dec 2017 08:51:35 +0000 (16:51 +0800)
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 a16238992af87b345cddb31e21babaca6bf14627..6dcdd340d86cd6861c87992d357952d4cb918b18 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);