Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
SYSTRACE("Command \"%s\" failed to connect command socket",
lxc_cmd_str(cmd->req.cmd));
- if (errno == ECONNREFUSED)
+ if (errno == ECONNREFUSED || errno == EPIPE)
*stopped = 1;
- if (errno == EPIPE) {
- *stopped = 1;
- client_fd = 0;
- }
-
return -1;
}
if (ret < 0 && errno == ECONNRESET)
*stopped = 1;
- if (!stay_connected || ret <= 0)
- if (client_fd >= 0) {
- saved_errno = errno;
- close(client_fd);
- errno = saved_errno;
- }
+ if (!stay_connected || ret <= 0) {
+ saved_errno = errno;
+ close(client_fd);
+ errno = saved_errno;
+ return ret;
+ }
if (stay_connected && ret > 0)
cmd->rsp.ret = client_fd;