Commit d73a08b1 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

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: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent c0857d25
...@@ -426,11 +426,6 @@ int prepare_file_locks(int pid) ...@@ -426,11 +426,6 @@ int prepare_file_locks(int pid)
if (!opts.handle_file_locks) if (!opts.handle_file_locks)
return 0; 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); return restore_file_locks(pid);
} }
...@@ -186,7 +186,6 @@ int collect_image(struct collect_image_info *cinfo) ...@@ -186,7 +186,6 @@ int collect_image(struct collect_image_info *cinfo)
if (!img) if (!img)
return -1; return -1;
cinfo->flags |= COLLECT_HAPPENED;
if (cinfo->flags & COLLECT_SHARED) { if (cinfo->flags & COLLECT_SHARED) {
o_alloc = shmalloc; o_alloc = shmalloc;
o_free = shfree_last; o_free = shfree_last;
...@@ -210,6 +209,7 @@ int collect_image(struct collect_image_info *cinfo) ...@@ -210,6 +209,7 @@ int collect_image(struct collect_image_info *cinfo)
break; break;
} }
cinfo->flags |= COLLECT_HAPPENED;
ret = cinfo->collect(obj, msg, img); ret = cinfo->collect(obj, msg, img);
if (ret < 0) { if (ret < 0) {
o_free(obj); o_free(obj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment