[CRIU] [PATCH 6/7] prepare_sigactions(): use pr_perror()

Andrew Vagin avagin at odin.com
Wed Oct 7 23:30:51 PDT 2015


On Wed, Oct 07, 2015 at 10:38:57PM -0700, Kir Kolyshkin wrote:
> 
> 
> On 10/07/2015 12:05 PM, Andrey Wagin wrote:
> >
> >Moi
> >On Oct 7, 2015 7:25 PM, "Kir Kolyshkin" <kir at openvz.org
> ><mailto:kir at openvz.org>> wrote:
> >>
> >> Signed-off-by: Kir Kolyshkin <kir at openvz.org <mailto:kir at openvz.org>>
> >> ---
> >>  cr-restore.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/cr-restore.c b/cr-restore.c
> >> index 33205e4..1abfd16 100644
> >> --- a/cr-restore.c
> >> +++ b/cr-restore.c
> >> @@ -721,7 +721,7 @@ static int prepare_sigactions(void)
> >>                  */
> >>                 ret = sys_sigaction(sig, &act, NULL,
> >sizeof(k_rtsigset_t));
> >>                 if (ret == -1) {
> >> -                       pr_err("%d: Can't restore sigaction: %m\n",
> >pid);
> >> +                       pr_perror("%d: Can't restore sigaction", pid);
> >
> >sys_* doesn't set errno
> >
> 
> In this case it probably returns -E* code? If yes,
> 1. using %m (or  pr_perror()) is useless

yes
> 2. ret == -1 check is wrong
yes
> 3. to print error, we need something like strerror(-ret)

sys_* is used in pie code which is not linked with libc, so we can't use
strerror. I think it can be useful to have sterror for pie code.

> 
> Or is it something different?

I have sent a patch which should fix this issue.

Thanks.
> 
> 
> 

> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu



More information about the CRIU mailing list