commands_utils: fix lxc-wait

Closes: #3570 Fixes: 7792a5b6 ("commands: add additional check to lxc_cmd_sock_get_state()") Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 2cc8d550
......@@ -62,7 +62,7 @@ int lxc_cmd_sock_get_state(const char *name, const char *lxcpath,
ret = lxc_cmd_add_state_client(name, lxcpath, states, &state_client_fd);
if (ret < 0)
return ret_errno(EINVAL);
return -errno;
if (ret < MAX_STATE)
return ret;
......
......@@ -100,10 +100,8 @@ int lxc_wait(const char *lxcname, const char *states, int timeout,
if (state >= 0)
break;
if (errno != ECONNREFUSED) {
SYSERROR("Failed to receive state from monitor");
return -1;
}
if (errno != ECONNREFUSED)
return log_error_errno(-1, errno, "Failed to receive state from monitor");
if (timeout > 0)
timeout--;
......
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