Commit 870803fb authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

image: Shrink signal entry structure

Since we use pure syscalls there is no
need to keep intermediate layer for signals.

Moreover mask entry moved at the end of the structure
so we will easily expand it if it'll be ever needed.

Note it breaks backward compatibility with older image
but since it's development stage it should be safe.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
parent 650318f4
......@@ -1139,8 +1139,7 @@ static int prepare_sigactions(int pid)
ASSIGN_TYPED(act.rt_sa_handler, e.sigaction);
ASSIGN_TYPED(act.rt_sa_flags, e.flags);
ASSIGN_TYPED(act.rt_sa_restorer, e.restorer);
memcpy(&act.rt_sa_mask, &e.mask, sizeof(act.rt_sa_mask));
ASSIGN_TYPED(act.rt_sa_mask.sig[0], e.mask);
/*
* A pure syscall is used, because glibc
......
......@@ -89,9 +89,9 @@ struct page_entry {
struct sa_entry {
u64 sigaction;
u8 mask[128];
u64 flags;
u64 restorer;
u64 mask;
} __packed;
#define HEADER_VERSION 1
......
......@@ -257,8 +257,7 @@ static int dump_sigact(parasite_args_cmd_dumpsigacts_t *args)
ASSIGN_TYPED(e.sigaction, act.rt_sa_handler);
ASSIGN_TYPED(e.flags, act.rt_sa_flags);
ASSIGN_TYPED(e.restorer, act.rt_sa_restorer);
inline_memcpy(&e.mask, &act.rt_sa_mask, sizeof(e.mask));
ASSIGN_TYPED(e.mask, act.rt_sa_mask.sig[0]);
ret = sys_write(fd, &e, sizeof(e));
if (ret != sizeof(e)) {
......
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