criu/test
Dmitry Safonov 3bdaf5a9d8 zdtm: rely on -D_GNU_SOURCE passed from Makefiles
After the commit
  02c763939c10 ("test/zdtm: unify common code")

CFLAGS with -D_GNU_SOURCE defined in the top Makefile
are being passed to tests Makefiles.
As _GNU_SOURCE is also defined by tests, that resulted in
zdtm tests build failures:

  make[2]: Entering directory `/home/criu/test/zdtm/lib'
   CC        test.o
  test.c:1:0: error: "_GNU_SOURCE" redefined [-Werror]
   #define _GNU_SOURCE
   ^
  <command-line>:0:0: note: this is the location of the previous definition
  cc1: all warnings being treated as errors
  make[2]: *** [test.o] Error 1

However, we didn't catch this in time by Travis-CI, as zdtm.py doesn't
do `make zdtm`, rather it does `make -C test/zdtm/{lib,static,transition}`.
By calling middle makefile this way, it doesn't have _GNU_SOURCE in
CFLAGS from top-Makefile.

I think the right thing to do here - is following CRIU's way:
rely on definition of _GNU_SOURCE by Makefiles.

This patch is almost fully generated with
  find test/zdtm/ -name '*.c' -type f					\
     -exec sed -i '/define _GNU_SOURCE/{n;/^$/d;}' '{}' \;		\
     -exec sed -i '/define _GNU_SOURCE/d' '{}' \;

With an exception for adding -D_GNU_SOURCE in tests Makefile.inc for
keeping the same behaviour for zdtm.py.
Also changed utsname.c to use utsname::domainname, rather private
utsname::__domainname, as now it's uncovered (from sys/utsname.h):
> struct utsname
>  {
...
> # ifdef __USE_GNU
>     char domainname[_UTSNAME_DOMAIN_LENGTH];
> # else
>     char __domainname[_UTSNAME_DOMAIN_LENGTH];
> # endif

Reported-by: Adrian Reber <areber@redhat.com>
Cc: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-04-11 09:01:08 +03:00
..
compel compel/tests: fix tests on !x86 archs 2017-03-14 21:03:30 +03:00
inhfd unix: Test the --external instead of --ext-unix-sk 2016-11-03 18:14:16 +03:00
jenkins fault/vdso/restorer: add force-injection of trampolines 2017-03-15 09:36:07 +03:00
others travis: add "make uninstall" test 2017-04-02 18:09:34 +03:00
zdtm zdtm: rely on -D_GNU_SOURCE passed from Makefiles 2017-04-11 09:01:08 +03:00
.gitignore gitignores: ignore some more generated files 2017-03-15 00:05:55 +03:00
abrt.sh travis: catch core dump files in error cases 2016-09-06 19:31:20 +03:00
check_actions.py test: Check action scripts to work as we expect 2016-05-06 14:39:25 +03:00
crit-recode.py test/crit-recode: skip images with zero size 2016-06-28 13:12:26 +03:00
criu.py zdtm.py: Add minimal support for CRIU RPC testing 2016-09-06 19:31:21 +03:00
empty-netns-prep.sh empty-ns: Don't C/R iptables too (v2) 2016-11-17 11:05:37 +03:00
groups.desc zdtm.py: Generator of groups of tests 2015-12-08 14:54:41 +03:00
inhfd.desc zdtm.py: Add inhfd tests for --inherit-fd option 2015-10-19 12:42:01 +03:00
Makefile test/Makefile: rm bad code 2016-10-10 12:48:20 +03:00
rpc_pb2.py python lib: rename rpc.py to rpc_pb2.py 2016-10-10 12:49:28 +03:00
show_action.sh test: Check action scripts to work as we expect 2016-05-06 14:39:25 +03:00
umount2.c zdtm: add a program to umount a test root 2016-09-26 15:42:40 +03:00
zdtm.desc test: Get rid of live directory 2016-02-20 13:40:52 +03:00
zdtm.py zdtm: print 5 lines before an error 2017-04-02 18:12:11 +03:00
zdtm_ct.c test: don't do MS_REC|MS_PRIVATE for host mounts 2016-09-06 19:31:20 +03:00
zdtm_mount_cgroups tests: prevent zdtm_mount_cgroups from failing w/ EBUSY 2016-02-03 16:25:28 +03:00