[CRIU] [PATCH] cr-check: Inspect errno of prctl calls

Laurent Dufour ldufour at linux.vnet.ibm.com
Mon Mar 14 09:45:12 PDT 2016


Hi Filipe,

Thanks for catching this bug I raised ;)

On 14/03/2016 17:39, Filipe Brandenburger wrote:
> Hi Pavel,
> 
> On Mon, Mar 14, 2016 at 1:44 AM, Pavel Emelyanov <xemul at virtuozzo.com> wrote:
>>> +             if (ret < 0) {
>>> +                     if (errno == -EPERM)
>>
>> errno-s contain positive codes.
> 
> Yes I realized that after sending the patch... I also found other
> parts where it's still checking "ret" instead of "errno" so I started
> working on a more thorough fix. Will send you an updated patch
> shortly.
> 
>>>                       pr_msg("prctl: PR_SET_MM_EXE_FILE is not supported (%d)\n", ret);
>>
>> Printing ret would be not informative, please, print errno instead.
> 
> Ah good catch! I hadn't noticed that, will update that now as well.

I think it would be even more user friendly to print the associated
error message instead of the errno value, isn't it ?

Cheers,
Laurent.



More information about the CRIU mailing list