Skip to content

Commit

Permalink
commands_utils: fix lxc-wait
Browse files Browse the repository at this point in the history
Closes: #3570
Fixes: 7792a5b ("commands: add additional check to lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Nov 18, 2020
1 parent 2cc8d55 commit d2bab66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lxc/commands_utils.c
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions src/lxc/state.c
Expand Up @@ -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--;
Expand Down

0 comments on commit d2bab66

Please sign in to comment.