Skip to content

Commit

Permalink
[monitor] wrong statement of break
Browse files Browse the repository at this point in the history
if lxc_abstract_unix_connect fail and return -1,  this code never goto retry.

Signed-off-by: liuhao <liuhao27@huawei.com>
  • Loading branch information
duguhaotian authored and Christian Brauner committed Jan 1, 2018
1 parent 457df41 commit ddbb1db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/monitor.c
Expand Up @@ -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);
Expand Down

0 comments on commit ddbb1db

Please sign in to comment.