Callers can then make a decision whether they want to consider the peer closing
the connection an error or not. For example, a c->wait(c, "STOPPED", -1) call
can then consider a ECONNRESET not an error but rather see it - correctly - as
a container exiting before being able to register a state client.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
if (ret < 0) {
WARN("%s - Failed to receive response for command \"%s\"",
strerror(errno), lxc_cmd_str(cmd->req.cmd));
+ if (errno == ECONNRESET)
+ return -ECONNRESET;
+
return -1;
}
TRACE("Command \"%s\" received response", lxc_cmd_str(cmd->req.cmd));
}
ret = lxc_cmd_rsp_recv(client_fd, cmd);
+ if (ret == -ECONNRESET)
+ *stopped = 1;
out:
if (!stay_connected || ret <= 0)
close(client_fd);