2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

restorer: remove always true `has_futex' arg

Check for presence of robust futex list is in the reality
(futex_rla_len != 0).

That does code on dumping, in get_task_futex_robust_list():
> ret = syscall(SYS_get_robust_list, pid, &head, &len);
> if (ret < 0 && errno == ENOSYS) {
[..]
> 	len = 0;
[..]
> }
[..]
> info->futex_rla_len	= (u32)len;

And in images: futex_rla_len == 0 means that futex is not present.

So, we don't need additional restorer's parameter `has_futex'
which is always true, remove it.

Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Dmitry Safonov
2017-05-03 22:40:13 +03:00
committed by Andrei Vagin
parent ea6357e651
commit d011a9fb42
3 changed files with 1 additions and 3 deletions

View File

@@ -3237,7 +3237,6 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
rst_reloc_creds(&thread_args[i], &creds_pos_next);
thread_args[i].has_futex = true;
thread_args[i].futex_rla = tcore->thread_core->futex_rla;
thread_args[i].futex_rla_len = tcore->thread_core->futex_rla_len;
thread_args[i].pdeath_sig = tcore->thread_core->pdeath_sig;

View File

@@ -82,7 +82,6 @@ struct thread_restore_args {
UserRegsEntry gpregs;
u64 clear_tid_addr;
bool has_futex;
u64 futex_rla;
u32 futex_rla_len;

View File

@@ -426,7 +426,7 @@ static int restore_thread_common(struct thread_restore_args *args)
{
sys_set_tid_address((int *)decode_pointer(args->clear_tid_addr));
if (args->has_futex && args->futex_rla_len) {
if (args->futex_rla_len) {
int ret;
ret = sys_set_robust_list(decode_pointer(args->futex_rla),