2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

v2 service: don't send dump response in case of self-dump without leave_running

Currently we have a bug: if no leave_running is set in request, service won't send dump response. We must not send response only if it was a self-dump request and no leave_running option was set.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Ruslan Kuprieiev 2013-12-02 19:50:44 +04:00 committed by Pavel Emelyanov
parent 7be5a1b95d
commit 2e8ff1a22a

View File

@ -166,6 +166,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
static int dump_using_req(int sk, CriuOpts *req)
{
bool success = false;
bool self_dump = !req->pid;
if (setup_opts_from_req(sk, req) == -1) {
pr_perror("Arguments treating fail");
@ -175,7 +176,7 @@ static int dump_using_req(int sk, CriuOpts *req)
if (cr_dump_tasks(req->pid) == -1)
goto exit;
if (req->has_leave_running && req->leave_running) {
if (req->leave_running || !self_dump) {
success = true;
exit:
if (send_criu_dump_resp(sk, success, false) == -1) {