[CRIU] [PATCH] Move headers around to fix issues on custom-built glibc

Nikolay Borisov n.borisov at siteground.com
Tue Aug 16 09:25:22 PDT 2016


On Tue, Aug 16, 2016 at 7:09 PM, Dmitry Safonov <dsafonov at virtuozzo.com> wrote:
> On 08/16/2016 06:52 PM, Dmitry Safonov wrote:
>>
>> Hi,
>>
>> On 08/16/2016 06:13 PM, Nikolay Borisov wrote:
>>>
>>> diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
>>> index 51eab133f269..54ccf8465f7f 100644
>>> --- a/criu/arch/x86/crtools.c
>>> +++ b/criu/arch/x86/crtools.c
>>> @@ -11,9 +11,9 @@
>>>
>>>  #include "cr_options.h"
>>>  #include "compiler.h"
>>> +#include "restorer.h"
>>>  #include "ptrace.h"
>>>  #include "parasite-syscall.h"
>>> -#include "restorer.h"
>>>  #include "log.h"
>>>  #include "util.h"
>>>  #include "cpu.h"
>>>
>>
>> Hmm, from my POV, one should avoid hard include seq-dependencies as
>> much as possible.
>> As F_{S,G}ETPIPE_SZ are defined both in fcntl.h and config-base.h,
>> can we do something like that? Am I missing something?
>>
>
> I replaced system includes with a wrapper only for users of
> F_{S,G}ETPIPE_SZ -- maybe we should even convert *all* includes of
> system header to wrapper?
> It would be a noisy patch, but for a long perspective it may come
> as a better solution than manually checking order of includes.
>

I think switching to CRIU"s provided fcntl.h is identical to what I
did. Because in it there are ifdef guards but in the system-provided
fcntl there isn't. So in case "fcntl.h" is included before the system
one, it will define F_SETPIPE_SZ etc and when the system header is
included it will cause gcc warnings.


> --
>              Dmitry


More information about the CRIU mailing list