kerndat: include config.h before using CONFIG_* contants

Submitted by Andrei Vagin on June 27, 2017, 3:50 a.m.

Details

Message ID 20170627035043.499-1-avagin@openvz.org
State Accepted
Series "kerndat: include config.h before using CONFIG_* contants"
Headers show

Commit Message

Andrei Vagin June 27, 2017, 3:50 a.m.
From: Andrei Vagin <avagin@virtuozzo.com>

Otherwise someone can include kerndat.h before config.h
and get another kerndat structure. For example, proc_parse
doesn't include config.h and Cyrill met this problem.

Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/include/kerndat.h | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
index 2035f79..8eaa06d 100644
--- a/criu/include/kerndat.h
+++ b/criu/include/kerndat.h
@@ -3,6 +3,7 @@ 
 
 #include <stdbool.h>
 #include "int.h"
+#include "config.h"
 #ifdef CONFIG_VDSO
 #include "util-vdso.h"
 #endif

Comments

Cyrill Gorcunov June 27, 2017, 6:12 a.m.
Ack! Thank you!

On Tue, Jun 27, 2017, 06:51 Andrei Vagin <avagin@openvz.org> wrote:

> From: Andrei Vagin <avagin@virtuozzo.com>
>
> Otherwise someone can include kerndat.h before config.h
> and get another kerndat structure. For example, proc_parse
> doesn't include config.h and Cyrill met this problem.
>
> Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
> Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> ---
>  criu/include/kerndat.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
> index 2035f79..8eaa06d 100644
> --- a/criu/include/kerndat.h
> +++ b/criu/include/kerndat.h
> @@ -3,6 +3,7 @@
>
>  #include <stdbool.h>
>  #include "int.h"
> +#include "config.h"
>  #ifdef CONFIG_VDSO
>  #include "util-vdso.h"
>  #endif
> --
> 2.9.4
>
>
Dmitry Safonov June 27, 2017, 9:45 a.m.
On 06/27/2017 06:50 AM, Andrei Vagin wrote:
> From: Andrei Vagin <avagin@virtuozzo.com>
> 
> Otherwise someone can include kerndat.h before config.h
> and get another kerndat structure. For example, proc_parse
> doesn't include config.h and Cyrill met this problem.
> 
> Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
> Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>

Thanks, LGTM:
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>

> ---
>   criu/include/kerndat.h | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
> index 2035f79..8eaa06d 100644
> --- a/criu/include/kerndat.h
> +++ b/criu/include/kerndat.h
> @@ -3,6 +3,7 @@
>   
>   #include <stdbool.h>
>   #include "int.h"
> +#include "config.h"
>   #ifdef CONFIG_VDSO
>   #include "util-vdso.h"
>   #endif
>
Andrey Vagin June 27, 2017, 6:25 p.m.
Applied
On Tue, Jun 27, 2017 at 06:50:43AM +0300, Andrei Vagin wrote:
> From: Andrei Vagin <avagin@virtuozzo.com>
> 
> Otherwise someone can include kerndat.h before config.h
> and get another kerndat structure. For example, proc_parse
> doesn't include config.h and Cyrill met this problem.
> 
> Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
> Cc: Cyrill Gorcunov <gorcunov@openvz.org>
> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
> ---
>  criu/include/kerndat.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
> index 2035f79..8eaa06d 100644
> --- a/criu/include/kerndat.h
> +++ b/criu/include/kerndat.h
> @@ -3,6 +3,7 @@
>  
>  #include <stdbool.h>
>  #include "int.h"
> +#include "config.h"
>  #ifdef CONFIG_VDSO
>  #include "util-vdso.h"
>  #endif
> -- 
> 2.9.4
>