Closes: #3570
Fixes: 7792a5b60f79 ("commands: add additional check to lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
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;
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--;