Unverified Commit ddbb1dbc by 独孤昊天 Committed by Christian Brauner

[monitor] wrong statement of break

if lxc_abstract_unix_connect fail and return -1, this code never goto retry. Signed-off-by: 's avatarliuhao <liuhao27@huawei.com>
parent 457df41b
...@@ -232,7 +232,7 @@ int lxc_monitor_open(const char *lxcpath) ...@@ -232,7 +232,7 @@ int lxc_monitor_open(const char *lxcpath)
for (retry = 0; retry < sizeof(backoff_ms) / sizeof(backoff_ms[0]); retry++) { for (retry = 0; retry < sizeof(backoff_ms) / sizeof(backoff_ms[0]); retry++) {
fd = lxc_abstract_unix_connect(addr.sun_path); fd = lxc_abstract_unix_connect(addr.sun_path);
if (fd < 0 || errno != ECONNREFUSED) if (fd != -1 || errno != ECONNREFUSED)
break; break;
ERROR("Failed to connect to monitor socket. Retrying in %d ms: %s", backoff_ms[retry], strerror(errno)); ERROR("Failed to connect to monitor socket. Retrying in %d ms: %s", backoff_ms[retry], strerror(errno));
usleep(backoff_ms[retry] * 1000); usleep(backoff_ms[retry] * 1000);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment