struct ckpt_sigset is defined to match the size of sigset_t. Compilation should fail if it does not. Am I missing something ? Oren. Matt Helsley wrote: > Only copy the minimum size of the two structs. I believe gcc > will recognize that these are constants so the resulting code > should be the same size and just as fast. > > Signed-off-by: Matt Helsley <matthltc@xxxxxxxxxx> > --- > checkpoint/signal.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/checkpoint/signal.c b/checkpoint/signal.c > index 989b974..c65ee00 100644 > --- a/checkpoint/signal.c > +++ b/checkpoint/signal.c > @@ -22,12 +22,12 @@ > > static inline void fill_sigset(struct ckpt_sigset *h, sigset_t *sigset) > { > - memcpy(&h->sigset, sigset, sizeof(*sigset)); > + memcpy(&h->sigset, sigset, min(sizeof(*h), sizeof(*sigset))); > } > > static inline void load_sigset(sigset_t *sigset, struct ckpt_sigset *h) > { > - memcpy(sigset, &h->sigset, sizeof(*sigset)); > + memcpy(sigset, &h->sigset, min(sizeof(*h), sizeof(*sigset))); > } > > /*********************************************************************** _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers