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

image: Fix "collect happenned" flag

This flag now means "image was opened", while the "empty image"
concept makes this always true. Since there's one user of this
flag, which is obviously incorrect, remove the latter and fix
the former to mean "at least one object was read".

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Pavel Emelyanov 2017-06-30 13:55:47 +03:00 committed by Andrei Vagin
parent c0857d2517
commit d73a08b176
2 changed files with 1 additions and 6 deletions

View File

@ -426,11 +426,6 @@ int prepare_file_locks(int pid)
if (!opts.handle_file_locks)
return 0;
if (!(file_locks_cinfo.flags & COLLECT_HAPPENED)) {
pr_warn("Per-pid file locks are deprecated\n");
return -1;
}
return restore_file_locks(pid);
}

View File

@ -186,7 +186,6 @@ int collect_image(struct collect_image_info *cinfo)
if (!img)
return -1;
cinfo->flags |= COLLECT_HAPPENED;
if (cinfo->flags & COLLECT_SHARED) {
o_alloc = shmalloc;
o_free = shfree_last;
@ -210,6 +209,7 @@ int collect_image(struct collect_image_info *cinfo)
break;
}
cinfo->flags |= COLLECT_HAPPENED;
ret = cinfo->collect(obj, msg, img);
if (ret < 0) {
o_free(obj);