[CRIU] [PATCH v2] test/zdtm: fix compilation of maps02.c when MADV_DONTDUMP is unknown

Andrew Vagin avagin at parallels.com
Fri Oct 3 06:45:27 PDT 2014


On Fri, Oct 03, 2014 at 03:22:23PM +0200, Nicolas Dichtel wrote:
> Error was:
> maps02.c: In function ‘main’:
> maps02.c:57:74: error: ‘MADV_DONTDUMP’ undeclared (first use in this function)
> maps02.c:57:74: note: each undeclared identifier is reported only once for each function it appears in
> make: *** [maps02] Error 1
> ERROR: fail to start /home/root/criu/test/zdtm/live/static/maps02
>

Acked-by: Andrew Vagin <avagin at parallels.com>
 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel at 6wind.com>
> ---
> 
> v2: don't include asm-generic/mman-common.h, just check if MADV_DONTDUMP
>     exists
> 
>  test/zdtm/live/static/maps02.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/test/zdtm/live/static/maps02.c b/test/zdtm/live/static/maps02.c
> index 336044fea672..9473d94ca0b6 100644
> --- a/test/zdtm/live/static/maps02.c
> +++ b/test/zdtm/live/static/maps02.c
> @@ -1,6 +1,10 @@
>  #include <sys/mman.h>
>  #include "zdtmtst.h"
>  
> +#ifndef MADV_DONTDUMP
> +#define MADV_DONTDUMP   16
> +#endif
> +
>  const char *test_doc	= "Test shared memory with advises";
>  const char *test_author	= "Cyrill Gorcunov <gorcunov at openvz.org>";
>  
> -- 
> 2.1.0
> 


More information about the CRIU mailing list