From: Christian Brauner Date: Fri, 3 Sep 2021 15:47:49 +0000 (+0200) Subject: tree-wide: fix config.h inclusion X-Git-Tag: lxc-5.0.0~92^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1160ce891d285f666fbae3fe97bfd73078dd84d6;p=thirdparty%2Flxc.git tree-wide: fix config.h inclusion Signed-off-by: Christian Brauner --- diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c index 4f8e2fad6..7dae44c59 100644 --- a/src/lxc/af_unix.c +++ b/src/lxc/af_unix.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include #include "af_unix.h" -#include "config.h" #include "log.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/af_unix.h b/src/lxc/af_unix.h index 77c115a3b..ba119cffc 100644 --- a/src/lxc/af_unix.h +++ b/src/lxc/af_unix.h @@ -3,6 +3,8 @@ #ifndef __LXC_AF_UNIX_H #define __LXC_AF_UNIX_H +#include "config.h" + #include #include #include diff --git a/src/lxc/api_extensions.h b/src/lxc/api_extensions.h index 04e37fd54..bdffa649f 100644 --- a/src/lxc/api_extensions.h +++ b/src/lxc/api_extensions.h @@ -3,11 +3,11 @@ #ifndef __LXC_API_EXTENSIONS_H #define __LXC_API_EXTENSIONS_H +#include "config.h" + #include #include -#include "config.h" - /* * api_extensions is the list of all API extensions in the order they were * added. diff --git a/src/lxc/attach.c b/src/lxc/attach.c index a1b16607a..93a1162eb 100644 --- a/src/lxc/attach.c +++ b/src/lxc/attach.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -31,7 +30,6 @@ #include "cgroups/cgroup_utils.h" #include "commands.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "log.h" #include "lsm/lsm.h" diff --git a/src/lxc/attach.h b/src/lxc/attach.h index d9b356bbf..c85b84fbe 100644 --- a/src/lxc/attach.h +++ b/src/lxc/attach.h @@ -3,6 +3,8 @@ #ifndef __LXC_ATTACH_H #define __LXC_ATTACH_H +#include "config.h" + #include #include diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 3103263b3..b111f521c 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -14,10 +14,6 @@ #include "config.h" -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - #include #include #include diff --git a/src/lxc/cgroups/cgroup.c b/src/lxc/cgroups/cgroup.c index aef7ad84d..8f6e49e04 100644 --- a/src/lxc/cgroups/cgroup.c +++ b/src/lxc/cgroups/cgroup.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include "cgroup2_devices.h" #include "compiler.h" #include "conf.h" -#include "config.h" #include "initutils.h" #include "memory_utils.h" #include "log.h" diff --git a/src/lxc/cgroups/cgroup.h b/src/lxc/cgroups/cgroup.h index 42285ff40..d26559d11 100644 --- a/src/lxc/cgroups/cgroup.h +++ b/src/lxc/cgroups/cgroup.h @@ -3,6 +3,8 @@ #ifndef __LXC_CGROUP_H #define __LXC_CGROUP_H +#include "config.h" + #include #include #include diff --git a/src/lxc/cgroups/cgroup2_devices.c b/src/lxc/cgroups/cgroup2_devices.c index 5ccd35fd8..480859ccc 100644 --- a/src/lxc/cgroups/cgroup2_devices.c +++ b/src/lxc/cgroups/cgroup2_devices.c @@ -2,9 +2,8 @@ /* Parts of this taken from systemd's implementation. */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -16,7 +15,6 @@ #include #include "cgroup2_devices.h" -#include "config.h" #include "file_utils.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/cgroups/cgroup2_devices.h b/src/lxc/cgroups/cgroup2_devices.h index 31896d292..4b0fb7362 100644 --- a/src/lxc/cgroups/cgroup2_devices.h +++ b/src/lxc/cgroups/cgroup2_devices.h @@ -5,6 +5,8 @@ #ifndef __LXC_CGROUP2_DEVICES_H #define __LXC_CGROUP2_DEVICES_H +#include "config.h" + #include #include #include @@ -18,7 +20,6 @@ #include "cgroup.h" #include "compiler.h" #include "conf.h" -#include "config.h" #include "list.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/cgroups/cgroup_utils.c b/src/lxc/cgroups/cgroup_utils.c index 78bd9ecb0..c5fb91c2f 100644 --- a/src/lxc/cgroups/cgroup_utils.c +++ b/src/lxc/cgroups/cgroup_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include "cgroup.h" #include "cgroup_utils.h" -#include "config.h" #include "file_utils.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/cgroups/cgroup_utils.h b/src/lxc/cgroups/cgroup_utils.h index b18621d30..5b23e912f 100644 --- a/src/lxc/cgroups/cgroup_utils.h +++ b/src/lxc/cgroups/cgroup_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_CGROUP_UTILS_H #define __LXC_CGROUP_UTILS_H +#include "config.h" + #include #include diff --git a/src/lxc/commands.c b/src/lxc/commands.c index 4c2f77ada..4b52ff736 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -22,7 +21,6 @@ #include "commands.h" #include "commands_utils.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "log.h" #include "lxc.h" diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c index 8f77880e6..3558ff7e2 100644 --- a/src/lxc/commands_utils.c +++ b/src/lxc/commands_utils.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */ +#include "config.h" + #include #include #include @@ -17,7 +15,6 @@ #include "af_unix.h" #include "commands.h" #include "commands_utils.h" -#include "config.h" #include "file_utils.h" #include "initutils.h" #include "log.h" diff --git a/src/lxc/commands_utils.h b/src/lxc/commands_utils.h index 0bdf7a2e8..28ce4907a 100644 --- a/src/lxc/commands_utils.h +++ b/src/lxc/commands_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_COMMANDS_UTILS_H #define __LXC_COMMANDS_UTILS_H +#include "config.h" + #include #include "state.h" diff --git a/src/lxc/compiler.h b/src/lxc/compiler.h index 4b2fc1b3a..ec071dc83 100644 --- a/src/lxc/compiler.h +++ b/src/lxc/compiler.h @@ -3,15 +3,11 @@ #ifndef __LXC_COMPILER_H #define __LXC_COMPILER_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" #include #include -#include "config.h" - #ifndef thread_local #if __STDC_VERSION__ >= 201112L && \ !(defined(__STDC_NO_THREADS__) || \ diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 6b1cfd4be..f4cb4b5e2 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -26,7 +24,6 @@ #include "af_unix.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "confile_utils.h" #include "netns_ifaddrs.h" @@ -36,7 +33,6 @@ #include "memory_utils.h" #include "network.h" #include "parse.h" -#include "storage/storage.h" #include "utils.h" #ifndef HAVE_STRLCPY diff --git a/src/lxc/confile.h b/src/lxc/confile.h index f085d1e22..d9b20c64e 100644 --- a/src/lxc/confile.h +++ b/src/lxc/confile.h @@ -3,6 +3,8 @@ #ifndef __LXC_CONFILE_H #define __LXC_CONFILE_H +#include "config.h" + #include #include diff --git a/src/lxc/confile_utils.c b/src/lxc/confile_utils.c index ae05ddac3..5534daa41 100644 --- a/src/lxc/confile_utils.c +++ b/src/lxc/confile_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include "lxc.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "confile_utils.h" #include "error.h" diff --git a/src/lxc/confile_utils.h b/src/lxc/confile_utils.h index 7dae2aec7..ed7418dd6 100644 --- a/src/lxc/confile_utils.h +++ b/src/lxc/confile_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_CONFILE_UTILS_H #define __LXC_CONFILE_UTILS_H +#include "config.h" + #include #include "compiler.h" diff --git a/src/lxc/criu.c b/src/lxc/criu.c index 3d61bea6d..3ee736922 100644 --- a/src/lxc/criu.c +++ b/src/lxc/criu.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -19,7 +18,6 @@ #include "cgroup.h" #include "commands.h" #include "conf.h" -#include "config.h" #include "criu.h" #include "log.h" #include "lxc.h" diff --git a/src/lxc/criu.h b/src/lxc/criu.h index 234f79b79..873f88786 100644 --- a/src/lxc/criu.h +++ b/src/lxc/criu.h @@ -3,6 +3,8 @@ #ifndef __LXC_CRIU_H #define __LXC_CRIU_H +#include "config.h" + #include #include "lxc.h" diff --git a/src/lxc/error.c b/src/lxc/error.c index 51fe5092a..a3467d517 100644 --- a/src/lxc/error.c +++ b/src/lxc/error.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ +#include "config.h" + #include #include #include diff --git a/src/lxc/error_utils.h b/src/lxc/error_utils.h index ac0860d4f..614dd344a 100644 --- a/src/lxc/error_utils.h +++ b/src/lxc/error_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_ERROR_UTILS_H #define __LXC_ERROR_UTILS_H +#include "config.h" + #include #include "macro.h" diff --git a/src/lxc/execute.c b/src/lxc/execute.c index 346e127ab..6a7ae39f4 100644 --- a/src/lxc/execute.c +++ b/src/lxc/execute.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include #include "conf.h" -#include "config.h" #include "log.h" #include "start.h" #include "process_utils.h" diff --git a/src/lxc/file_utils.c b/src/lxc/file_utils.c index f7e4fb378..ca31690e4 100644 --- a/src/lxc/file_utils.c +++ b/src/lxc/file_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include #include -#include "config.h" #include "file_utils.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/file_utils.h b/src/lxc/file_utils.h index c9765da50..7d2af0128 100644 --- a/src/lxc/file_utils.h +++ b/src/lxc/file_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_FILE_UTILS_H #define __LXC_FILE_UTILS_H +#include "config.h" + #include #include #include diff --git a/src/lxc/freezer.c b/src/lxc/freezer.c index ef6afa046..718fbff39 100644 --- a/src/lxc/freezer.c +++ b/src/lxc/freezer.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -17,7 +16,6 @@ #include "cgroups/cgroup_utils.h" #include "commands.h" #include "commands_utils.h" -#include "config.h" #include "error.h" #include "log.h" #include "lxc.h" diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c index 397e94692..218125c1a 100644 --- a/src/lxc/initutils.c +++ b/src/lxc/initutils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include #include "compiler.h" -#include "config.h" #include "error.h" #include "file_utils.h" #include "initutils.h" diff --git a/src/lxc/list.h b/src/lxc/list.h index c984af451..3b363a9b6 100644 --- a/src/lxc/list.h +++ b/src/lxc/list.h @@ -3,6 +3,8 @@ #ifndef __LXC_LIST_H #define __LXC_LIST_H +#include "config.h" + #include #include "memory_utils.h" diff --git a/src/lxc/log.c b/src/lxc/log.c index 781cc2fa5..ac3713ecc 100644 --- a/src/lxc/log.c +++ b/src/lxc/log.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */ +#include "config.h" + #include #include #include @@ -21,7 +19,6 @@ #include "lxc.h" #include "caps.h" -#include "config.h" #include "file_utils.h" #include "log.h" #include "memory_utils.h" diff --git a/src/lxc/lsm/apparmor.c b/src/lxc/lsm/apparmor.c index 2d81acdc8..fa4e4d6e0 100644 --- a/src/lxc/lsm/apparmor.c +++ b/src/lxc/lsm/apparmor.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include "caps.h" #include "cgroups/cgroup_utils.h" #include "conf.h" -#include "config.h" #include "initutils.h" #include "file_utils.h" #include "log.h" diff --git a/src/lxc/lsm/lsm.c b/src/lxc/lsm/lsm.c index f6692e4ee..d9380c4b3 100644 --- a/src/lxc/lsm/lsm.c +++ b/src/lxc/lsm/lsm.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include "compiler.h" #include "conf.h" -#include "config.h" #include "log.h" #include "lsm.h" diff --git a/src/lxc/lsm/lsm.h b/src/lxc/lsm/lsm.h index bb6a7e93c..a26abb812 100644 --- a/src/lxc/lsm/lsm.h +++ b/src/lxc/lsm/lsm.h @@ -3,6 +3,8 @@ #ifndef __LXC_LSM_H #define __LXC_LSM_H +#include "config.h" + struct lxc_conf; #include diff --git a/src/lxc/lsm/nop.c b/src/lxc/lsm/nop.c index ff9c4b86e..56b97aaf0 100644 --- a/src/lxc/lsm/nop.c +++ b/src/lxc/lsm/nop.c @@ -1,11 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include -#include "config.h" #include "lsm/lsm.h" static char *nop_process_label_get(struct lsm_ops *ops, pid_t pid) diff --git a/src/lxc/lsm/selinux.c b/src/lxc/lsm/selinux.c index e0833f1b7..7a34b9cc4 100644 --- a/src/lxc/lsm/selinux.c +++ b/src/lxc/lsm/selinux.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include "conf.h" -#include "config.h" #include "file_utils.h" #include "log.h" #include "lsm.h" diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h index 9cf8da67a..8ba9f62a6 100644 --- a/src/lxc/lxc.h +++ b/src/lxc/lxc.h @@ -3,6 +3,8 @@ #ifndef __LXC_LXC_H #define __LXC_LXC_H +#include "config.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index e51a1c463..ac4b312c0 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -36,7 +35,6 @@ #include "commands.h" #include "commands_utils.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "confile_utils.h" #include "criu.h" diff --git a/src/lxc/lxccontainer.h b/src/lxc/lxccontainer.h index 3386bfff6..2663d5e24 100644 --- a/src/lxc/lxccontainer.h +++ b/src/lxc/lxccontainer.h @@ -3,6 +3,8 @@ #ifndef __LXC_CONTAINER_H #define __LXC_CONTAINER_H +#include "config.h" + #include #include #include diff --git a/src/lxc/lxclock.c b/src/lxc/lxclock.c index 12be6ef00..acddc1380 100644 --- a/src/lxc/lxclock.c +++ b/src/lxc/lxclock.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -14,7 +13,6 @@ #include "lxc.h" -#include "config.h" #include "log.h" #include "lxclock.h" #include "memory_utils.h" diff --git a/src/lxc/lxclock.h b/src/lxc/lxclock.h index 38f49b5b4..a20d35680 100644 --- a/src/lxc/lxclock.h +++ b/src/lxc/lxclock.h @@ -3,6 +3,8 @@ #ifndef __LXC_LXCLOCK_H #define __LXC_LXCLOCK_H +#include "config.h" + #include #include #include diff --git a/src/lxc/lxcseccomp.h b/src/lxc/lxcseccomp.h index 41293bcea..070dcaf5a 100644 --- a/src/lxc/lxcseccomp.h +++ b/src/lxc/lxcseccomp.h @@ -3,9 +3,8 @@ #ifndef __LXC_LXCSECCOMP_H #define __LXC_LXCSECCOMP_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #ifdef HAVE_SECCOMP #include @@ -18,7 +17,6 @@ #include "compiler.h" #include "conf.h" -#include "config.h" #include "memory_utils.h" struct lxc_conf; diff --git a/src/lxc/macro.h b/src/lxc/macro.h index 2780c7454..9054c326c 100644 --- a/src/lxc/macro.h +++ b/src/lxc/macro.h @@ -3,10 +3,8 @@ #ifndef __LXC_MACRO_H #define __LXC_MACRO_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -22,7 +20,6 @@ #include #include "compiler.h" -#include "config.h" #ifndef PATH_MAX #define PATH_MAX 4096 diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c index 69152a897..ba20224ae 100644 --- a/src/lxc/mainloop.c +++ b/src/lxc/mainloop.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include -#include "config.h" #include "log.h" #include "macro.h" #include "mainloop.h" diff --git a/src/lxc/mainloop.h b/src/lxc/mainloop.h index 0197ee2dd..6d6d38cf8 100644 --- a/src/lxc/mainloop.h +++ b/src/lxc/mainloop.h @@ -3,6 +3,8 @@ #ifndef __LXC_MAINLOOP_H #define __LXC_MAINLOOP_H +#include "config.h" + #include #include "compiler.h" diff --git a/src/lxc/memory_utils.h b/src/lxc/memory_utils.h index f2352a175..757fa49d9 100644 --- a/src/lxc/memory_utils.h +++ b/src/lxc/memory_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_MEMORY_UTILS_H #define __LXC_MEMORY_UTILS_H +#include "config.h" + #include #include #include diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index b01355168..c9d4bcc9e 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -22,7 +21,6 @@ #include #include "af_unix.h" -#include "config.h" #include "error.h" #include "log.h" #include "lxclock.h" diff --git a/src/lxc/monitor.h b/src/lxc/monitor.h index 0f89e4ff6..ae1dcdf16 100644 --- a/src/lxc/monitor.h +++ b/src/lxc/monitor.h @@ -3,6 +3,8 @@ #ifndef __LXC_MONITOR_H #define __LXC_MONITOR_H +#include "config.h" + #include #include #include diff --git a/src/lxc/mount_utils.c b/src/lxc/mount_utils.c index 945de8c1a..bba75f933 100644 --- a/src/lxc/mount_utils.c +++ b/src/lxc/mount_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include diff --git a/src/lxc/mount_utils.h b/src/lxc/mount_utils.h index 7d6857866..ea392672d 100644 --- a/src/lxc/mount_utils.h +++ b/src/lxc/mount_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_MOUNT_UTILS_H #define __LXC_MOUNT_UTILS_H +#include "config.h" + #include #include #include diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c index 020840d01..d97d9b37b 100644 --- a/src/lxc/namespace.c +++ b/src/lxc/namespace.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include #include -#include "config.h" #include "log.h" #include "memory_utils.h" #include "namespace.h" diff --git a/src/lxc/namespace.h b/src/lxc/namespace.h index a744edb78..587e00b3a 100644 --- a/src/lxc/namespace.h +++ b/src/lxc/namespace.h @@ -3,6 +3,8 @@ #ifndef __LXC_NAMESPACE_H #define __LXC_NAMESPACE_H +#include "config.h" + #include #include #include diff --git a/src/lxc/network.c b/src/lxc/network.c index 6c6715d57..654561d44 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -29,7 +28,6 @@ #include "netns_ifaddrs.h" #include "af_unix.h" #include "conf.h" -#include "config.h" #include "file_utils.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/network.h b/src/lxc/network.h index 2b5c0901c..d5d3d54b6 100644 --- a/src/lxc/network.h +++ b/src/lxc/network.h @@ -3,6 +3,8 @@ #ifndef __LXC_NETWORK_H #define __LXC_NETWORK_H +#include "config.h" + #include #include #include diff --git a/src/lxc/nl.c b/src/lxc/nl.c index 27f62c50b..63cbf5ac5 100644 --- a/src/lxc/nl.c +++ b/src/lxc/nl.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include #include -#include "config.h" #include "log.h" #include "nl.h" diff --git a/src/lxc/nl.h b/src/lxc/nl.h index 1135d1f66..28058bc0e 100644 --- a/src/lxc/nl.h +++ b/src/lxc/nl.h @@ -3,6 +3,8 @@ #ifndef __LXC_NL_H #define __LXC_NL_H +#include "config.h" + #include #include "compiler.h" diff --git a/src/lxc/pam/pam_cgfs.c b/src/lxc/pam/pam_cgfs.c index 91efe5c80..01167fa47 100644 --- a/src/lxc/pam/pam_cgfs.c +++ b/src/lxc/pam/pam_cgfs.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -23,7 +22,6 @@ #include #include -#include "config.h" #include "file_utils.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/parse.c b/src/lxc/parse.c index 5a5b85345..c174de96c 100644 --- a/src/lxc/parse.c +++ b/src/lxc/parse.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include -#include "config.h" #include "file_utils.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/parse.h b/src/lxc/parse.h index e4808ed0f..fe3bb4b78 100644 --- a/src/lxc/parse.h +++ b/src/lxc/parse.h @@ -3,6 +3,8 @@ #ifndef __LXC_PARSE_H #define __LXC_PARSE_H +#include "config.h" + #include #include diff --git a/src/lxc/process_utils.c b/src/lxc/process_utils.c index 3dadeb7d7..76e27da0f 100644 --- a/src/lxc/process_utils.c +++ b/src/lxc/process_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include "compiler.h" -#include "config.h" #include "log.h" #include "macro.h" #include "process_utils.h" diff --git a/src/lxc/process_utils.h b/src/lxc/process_utils.h index e0157c631..2a5032c03 100644 --- a/src/lxc/process_utils.h +++ b/src/lxc/process_utils.h @@ -3,9 +3,8 @@ #ifndef __LXC_PROCESS_UTILS_H #define __LXC_PROCESS_UTILS_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -16,7 +15,6 @@ #include #include "compiler.h" -#include "config.h" #include "syscall_numbers.h" #ifndef CSIGNAL diff --git a/src/lxc/rexec.c b/src/lxc/rexec.c index 2d6345651..ee0b453db 100644 --- a/src/lxc/rexec.c +++ b/src/lxc/rexec.c @@ -1,15 +1,13 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include #include #include -#include "config.h" #include "file_utils.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/rexec.h b/src/lxc/rexec.h index 198d6cb08..c4967b08c 100644 --- a/src/lxc/rexec.h +++ b/src/lxc/rexec.h @@ -3,6 +3,8 @@ #ifndef __LXC_REXEC_H #define __LXC_REXEC_H +#include "config.h" + #include "compiler.h" __hidden extern int lxc_rexec(const char *memfd_name); diff --git a/src/lxc/ringbuf.c b/src/lxc/ringbuf.c index 43f363656..37ffc8f39 100644 --- a/src/lxc/ringbuf.c +++ b/src/lxc/ringbuf.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -13,7 +11,6 @@ #include #include -#include "config.h" #include "ringbuf.h" #include "syscall_wrappers.h" #include "utils.h" diff --git a/src/lxc/ringbuf.h b/src/lxc/ringbuf.h index 889b6e65c..bd9a4de1e 100644 --- a/src/lxc/ringbuf.h +++ b/src/lxc/ringbuf.h @@ -3,6 +3,8 @@ #ifndef __LXC_RINGBUF_H #define __LXC_RINGBUF_H +#include "config.h" + #include #include #include diff --git a/src/lxc/rtnl.c b/src/lxc/rtnl.c index cea7336c1..d1fe585e8 100644 --- a/src/lxc/rtnl.c +++ b/src/lxc/rtnl.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include -#include "config.h" #include "nl.h" #include "rtnl.h" diff --git a/src/lxc/rtnl.h b/src/lxc/rtnl.h index bfe66db05..5578c6f62 100644 --- a/src/lxc/rtnl.h +++ b/src/lxc/rtnl.h @@ -3,6 +3,8 @@ #ifndef __LXC_RTNL_H #define __LXC_RTNL_H +#include "config.h" + #include /* diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index 2b9ecaf69..6c56b8d0f 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include "af_unix.h" #include "commands.h" -#include "config.h" #include "log.h" #include "lxcseccomp.h" #include "mainloop.h" diff --git a/src/lxc/start.c b/src/lxc/start.c index 252fc8a8a..4eed60a21 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -36,7 +35,6 @@ #include "commands_utils.h" #include "compiler.h" #include "conf.h" -#include "config.h" #include "confile_utils.h" #include "error.h" #include "file_utils.h" diff --git a/src/lxc/start.h b/src/lxc/start.h index e3aa0e95e..86b4c29a4 100644 --- a/src/lxc/start.h +++ b/src/lxc/start.h @@ -3,6 +3,8 @@ #ifndef __LXC_START_H #define __LXC_START_H +#include "config.h" + #include #include #include diff --git a/src/lxc/state.c b/src/lxc/state.c index 0682b35da..5e26855d9 100644 --- a/src/lxc/state.c +++ b/src/lxc/state.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -19,7 +18,6 @@ #include "cgroup.h" #include "commands.h" #include "commands_utils.h" -#include "config.h" #include "log.h" #include "lxc.h" #include "monitor.h" diff --git a/src/lxc/state.h b/src/lxc/state.h index afb2fbb78..39a6f962d 100644 --- a/src/lxc/state.h +++ b/src/lxc/state.h @@ -3,6 +3,8 @@ #ifndef __LXC_STATE_H #define __LXC_STATE_H +#include "config.h" + #include "compiler.h" #define MAX_STATE_LENGTH (8 + 1) diff --git a/src/lxc/storage/btrfs.c b/src/lxc/storage/btrfs.c index e0b7586c3..270eb057e 100644 --- a/src/lxc/storage/btrfs.c +++ b/src/lxc/storage/btrfs.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -18,7 +17,6 @@ #include #include "btrfs.h" -#include "config.h" #include "log.h" #include "memory_utils.h" #include "rsync.h" diff --git a/src/lxc/storage/btrfs.h b/src/lxc/storage/btrfs.h index 210a4e21d..72849f943 100644 --- a/src/lxc/storage/btrfs.h +++ b/src/lxc/storage/btrfs.h @@ -3,6 +3,8 @@ #ifndef __LXC_BTRFS_H #define __LXC_BTRFS_H +#include "config.h" + #include #include /* __le64, __l32 ... */ #include diff --git a/src/lxc/storage/dir.c b/src/lxc/storage/dir.c index 03ad036d5..dca510140 100644 --- a/src/lxc/storage/dir.c +++ b/src/lxc/storage/dir.c @@ -1,13 +1,11 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include -#include "config.h" #include "log.h" #include "macro.h" #include "memory_utils.h" diff --git a/src/lxc/storage/dir.h b/src/lxc/storage/dir.h index 24d8c53ff..c74e369cf 100644 --- a/src/lxc/storage/dir.h +++ b/src/lxc/storage/dir.h @@ -3,6 +3,8 @@ #ifndef __LXC_DIR_H #define __LXC_DIR_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/loop.c b/src/lxc/storage/loop.c index eebc1b67c..870b84c52 100644 --- a/src/lxc/storage/loop.c +++ b/src/lxc/storage/loop.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -15,7 +13,6 @@ #include #include -#include "config.h" #include "log.h" #include "loop.h" #include "memory_utils.h" diff --git a/src/lxc/storage/loop.h b/src/lxc/storage/loop.h index 9b04f09b2..c9be261ab 100644 --- a/src/lxc/storage/loop.h +++ b/src/lxc/storage/loop.h @@ -3,6 +3,8 @@ #ifndef __LXC_LOOP_H #define __LXC_LOOP_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/lvm.c b/src/lxc/storage/lvm.c index ed53bd086..208dcc9d0 100644 --- a/src/lxc/storage/lvm.c +++ b/src/lxc/storage/lvm.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -13,7 +11,6 @@ #include #include -#include "config.h" #include "log.h" #include "lvm.h" #include "memory_utils.h" diff --git a/src/lxc/storage/lvm.h b/src/lxc/storage/lvm.h index 8d3dd6a9f..7351e1a3a 100644 --- a/src/lxc/storage/lvm.h +++ b/src/lxc/storage/lvm.h @@ -3,6 +3,8 @@ #ifndef __LXC_LVM_H #define __LXC_LVM_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/nbd.c b/src/lxc/storage/nbd.c index 06515b833..e27a98102 100644 --- a/src/lxc/storage/nbd.c +++ b/src/lxc/storage/nbd.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include #include -#include "config.h" #include "log.h" #include "memory_utils.h" #include "nbd.h" diff --git a/src/lxc/storage/nbd.h b/src/lxc/storage/nbd.h index f6e4fb87c..f9c538663 100644 --- a/src/lxc/storage/nbd.h +++ b/src/lxc/storage/nbd.h @@ -3,6 +3,8 @@ #ifndef __LXC_NBD_H #define __LXC_NBD_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c index 86c21a96d..f8094fada 100644 --- a/src/lxc/storage/overlay.c +++ b/src/lxc/storage/overlay.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include "lxc.h" #include "conf.h" -#include "config.h" #include "confile.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/storage/overlay.h b/src/lxc/storage/overlay.h index bed876e80..a33961792 100644 --- a/src/lxc/storage/overlay.h +++ b/src/lxc/storage/overlay.h @@ -3,6 +3,8 @@ #ifndef __LXC_OVERLAY_H #define __LXC_OVERLAY_H +#include "config.h" + #include #include #include diff --git a/src/lxc/storage/rbd.c b/src/lxc/storage/rbd.c index f387ac21a..e1505e264 100644 --- a/src/lxc/storage/rbd.c +++ b/src/lxc/storage/rbd.c @@ -1,16 +1,13 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */ +#include "config.h" + #include /* Required for PRIu64 to work. */ #include #include #include #include -#include "config.h" #include "log.h" #include "memory_utils.h" #include "storage.h" diff --git a/src/lxc/storage/rbd.h b/src/lxc/storage/rbd.h index 56bfcb214..45f299ad7 100644 --- a/src/lxc/storage/rbd.h +++ b/src/lxc/storage/rbd.h @@ -3,6 +3,8 @@ #ifndef __LXC_RDB_H #define __LXC_RDB_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/rsync.c b/src/lxc/storage/rsync.c index c02a3f95d..572fe4a1b 100644 --- a/src/lxc/storage/rsync.c +++ b/src/lxc/storage/rsync.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include #include -#include "config.h" #include "log.h" #include "rsync.h" #include "storage.h" diff --git a/src/lxc/storage/rsync.h b/src/lxc/storage/rsync.h index c9e3210a1..ab30311c5 100644 --- a/src/lxc/storage/rsync.h +++ b/src/lxc/storage/rsync.h @@ -3,6 +3,8 @@ #ifndef __LXC_RSYNC_H #define __LXC_RSYNC_H +#include "config.h" + #include #include "compiler.h" diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c index e40ecee1f..8fb8fe6b4 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -22,7 +21,6 @@ #include "btrfs.h" #include "conf.h" -#include "config.h" #include "dir.h" #include "error.h" #include "log.h" diff --git a/src/lxc/storage/storage.h b/src/lxc/storage/storage.h index 62ac75e26..001a39c36 100644 --- a/src/lxc/storage/storage.h +++ b/src/lxc/storage/storage.h @@ -3,6 +3,8 @@ #ifndef __LXC_STORAGE_H #define __LXC_STORAGE_H +#include "config.h" + #include #include diff --git a/src/lxc/storage/storage_utils.c b/src/lxc/storage/storage_utils.c index d3548d21b..f50682159 100644 --- a/src/lxc/storage/storage_utils.c +++ b/src/lxc/storage/storage_utils.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -21,7 +20,6 @@ #include #include -#include "config.h" #include "log.h" #include "nbd.h" #include "parse.h" diff --git a/src/lxc/storage/storage_utils.h b/src/lxc/storage/storage_utils.h index 470e754c9..1ec9e0c3c 100644 --- a/src/lxc/storage/storage_utils.h +++ b/src/lxc/storage/storage_utils.h @@ -3,6 +3,8 @@ #ifndef __LXC_STORAGE_UTILS_H #define __LXC_STORAGE_UTILS_H +#include "config.h" + #include #include #include diff --git a/src/lxc/storage/zfs.c b/src/lxc/storage/zfs.c index 6e3c739af..8a9bc16f2 100644 --- a/src/lxc/storage/zfs.c +++ b/src/lxc/storage/zfs.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include #include -#include "config.h" #include "log.h" #include "parse.h" #include "rsync.h" diff --git a/src/lxc/storage/zfs.h b/src/lxc/storage/zfs.h index da8f66bec..9890d377e 100644 --- a/src/lxc/storage/zfs.h +++ b/src/lxc/storage/zfs.h @@ -3,6 +3,8 @@ #ifndef __LXC_ZFS_H #define __LXC_ZFS_H +#include "config.h" + #include #include #include diff --git a/src/lxc/string_utils.h b/src/lxc/string_utils.h index 7bf4f585a..7abbc537f 100644 --- a/src/lxc/string_utils.h +++ b/src/lxc/string_utils.h @@ -3,10 +3,10 @@ #ifndef __LXC_STRING_UTILS_H #define __LXC_STRING_UTILS_H -#include - #include "config.h" +#include + #include "initutils.h" #include "macro.h" diff --git a/src/lxc/sync.c b/src/lxc/sync.c index d8917ba7e..1075d987a 100644 --- a/src/lxc/sync.c +++ b/src/lxc/sync.c @@ -1,15 +1,13 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include #include #include -#include "config.h" #include "log.h" #include "start.h" #include "sync.h" diff --git a/src/lxc/sync.h b/src/lxc/sync.h index c621f41f8..6703eda02 100644 --- a/src/lxc/sync.h +++ b/src/lxc/sync.h @@ -3,6 +3,8 @@ #ifndef __LXC_SYNC_H #define __LXC_SYNC_H +#include "config.h" + #include #include "compiler.h" diff --git a/src/lxc/syscall_numbers.h b/src/lxc/syscall_numbers.h index 97273b449..ae5fdd064 100644 --- a/src/lxc/syscall_numbers.h +++ b/src/lxc/syscall_numbers.h @@ -2,9 +2,8 @@ #ifndef __LXC_SYSCALL_NUMBERS_H #define __LXC_SYSCALL_NUMBERS_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h index b545b0365..10f2fff34 100644 --- a/src/lxc/syscall_wrappers.h +++ b/src/lxc/syscall_wrappers.h @@ -3,9 +3,8 @@ #ifndef __LXC_SYSCALL_WRAPPER_H #define __LXC_SYSCALL_WRAPPER_H -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include #include -#include "config.h" #include "macro.h" #include "syscall_numbers.h" diff --git a/src/lxc/terminal.c b/src/lxc/terminal.c index b86d8c59a..8c84f2875 100644 --- a/src/lxc/terminal.c +++ b/src/lxc/terminal.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -20,7 +19,6 @@ #include "caps.h" #include "commands.h" #include "conf.h" -#include "config.h" #include "log.h" #include "lxclock.h" #include "mainloop.h" diff --git a/src/lxc/terminal.h b/src/lxc/terminal.h index 194f88711..45d6a18cc 100644 --- a/src/lxc/terminal.h +++ b/src/lxc/terminal.h @@ -3,6 +3,8 @@ #ifndef __LXC_TERMINAL_H #define __LXC_TERMINAL_H +#include "config.h" + #include #include diff --git a/src/lxc/tools/lxc_attach.c b/src/lxc/tools/lxc_attach.c index 6a9ac817b..d7888ddf4 100644 --- a/src/lxc/tools/lxc_attach.c +++ b/src/lxc/tools/lxc_attach.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -20,7 +19,6 @@ #include "arguments.h" #include "attach.h" #include "caps.h" -#include "config.h" #include "confile.h" #include "log.h" #ifdef ENFORCE_MEMFD_REXEC diff --git a/src/lxc/tools/lxc_autostart.c b/src/lxc/tools/lxc_autostart.c index 4a5031810..91596d4f6 100644 --- a/src/lxc/tools/lxc_autostart.c +++ b/src/lxc/tools/lxc_autostart.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -11,7 +10,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "list.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_cgroup.c b/src/lxc/tools/lxc_cgroup.c index edfc03c28..eb96c63ee 100644 --- a/src/lxc/tools/lxc_cgroup.c +++ b/src/lxc/tools/lxc_cgroup.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" lxc_log_define(lxc_cgroup, lxc); diff --git a/src/lxc/tools/lxc_checkpoint.c b/src/lxc/tools/lxc_checkpoint.c index 22abf1866..a8edb4526 100644 --- a/src/lxc/tools/lxc_checkpoint.c +++ b/src/lxc/tools/lxc_checkpoint.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -13,7 +12,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_config.c b/src/lxc/tools/lxc_config.c index 333dde54f..e4424c4cf 100644 --- a/src/lxc/tools/lxc_config.c +++ b/src/lxc/tools/lxc_config.c @@ -1,15 +1,12 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include "lxc.h" -#include "config.h" - struct lxc_config_items { char *name; }; diff --git a/src/lxc/tools/lxc_console.c b/src/lxc/tools/lxc_console.c index d11827121..7f43f506b 100644 --- a/src/lxc/tools/lxc_console.c +++ b/src/lxc/tools/lxc_console.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -20,7 +19,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_copy.c b/src/lxc/tools/lxc_copy.c index 384a7e3c8..d497610d0 100644 --- a/src/lxc/tools/lxc_copy.c +++ b/src/lxc/tools/lxc_copy.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -21,7 +20,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "storage_utils.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_create.c b/src/lxc/tools/lxc_create.c index 6af554031..f0482867a 100644 --- a/src/lxc/tools/lxc_create.c +++ b/src/lxc/tools/lxc_create.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -14,7 +13,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "storage_utils.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_device.c b/src/lxc/tools/lxc_device.c index ed69cdfd7..82e543462 100644 --- a/src/lxc/tools/lxc_device.c +++ b/src/lxc/tools/lxc_device.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -14,7 +13,6 @@ #include "netns_ifaddrs.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_execute.c b/src/lxc/tools/lxc_execute.c index a706d94db..5b6a863b4 100644 --- a/src/lxc/tools/lxc_execute.c +++ b/src/lxc/tools/lxc_execute.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -18,7 +17,6 @@ #include "arguments.h" #include "caps.h" -#include "config.h" #include "confile.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_freeze.c b/src/lxc/tools/lxc_freeze.c index cf5ff6162..c18779ba3 100644 --- a/src/lxc/tools/lxc_freeze.c +++ b/src/lxc/tools/lxc_freeze.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" lxc_log_define(lxc_freeze, lxc); diff --git a/src/lxc/tools/lxc_info.c b/src/lxc/tools/lxc_info.c index 12b2562d3..9755a503d 100644 --- a/src/lxc/tools/lxc_info.c +++ b/src/lxc/tools/lxc_info.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_ls.c b/src/lxc/tools/lxc_ls.c index cc64f8732..23bee59de 100644 --- a/src/lxc/tools/lxc_ls.c +++ b/src/lxc/tools/lxc_ls.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#include +#include "config.h" + #include #include #include @@ -22,7 +20,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "memory_utils.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_monitor.c b/src/lxc/tools/lxc_monitor.c index aeb5ed8d0..6065f2683 100644 --- a/src/lxc/tools/lxc_monitor.c +++ b/src/lxc/tools/lxc_monitor.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS +#include "config.h" + #include #include #include @@ -27,7 +25,6 @@ #include "af_unix.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "macro.h" #include "monitor.h" diff --git a/src/lxc/tools/lxc_snapshot.c b/src/lxc/tools/lxc_snapshot.c index a920a595c..fc2e91c6b 100644 --- a/src/lxc/tools/lxc_snapshot.c +++ b/src/lxc/tools/lxc_snapshot.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -15,7 +14,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" lxc_log_define(lxc_snapshot, lxc); diff --git a/src/lxc/tools/lxc_stop.c b/src/lxc/tools/lxc_stop.c index e3cecb6b2..8787bacd5 100644 --- a/src/lxc/tools/lxc_stop.c +++ b/src/lxc/tools/lxc_stop.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_top.c b/src/lxc/tools/lxc_top.c index 35fe76b5a..d3db4142c 100644 --- a/src/lxc/tools/lxc_top.c +++ b/src/lxc/tools/lxc_top.c @@ -1,9 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif -#define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */ +#include "config.h" + #include #include #include @@ -21,7 +19,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "mainloop.h" #include "utils.h" diff --git a/src/lxc/tools/lxc_unfreeze.c b/src/lxc/tools/lxc_unfreeze.c index e5b287289..818447cad 100644 --- a/src/lxc/tools/lxc_unfreeze.c +++ b/src/lxc/tools/lxc_unfreeze.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -12,7 +11,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" lxc_log_define(lxc_unfreeze, lxc); diff --git a/src/lxc/tools/lxc_unshare.c b/src/lxc/tools/lxc_unshare.c index c77ac70e7..d53f4299b 100644 --- a/src/lxc/tools/lxc_unshare.c +++ b/src/lxc/tools/lxc_unshare.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -22,7 +21,6 @@ #include "arguments.h" #include "caps.h" -#include "config.h" #include "list.h" #include "log.h" #include "namespace.h" diff --git a/src/lxc/tools/lxc_wait.c b/src/lxc/tools/lxc_wait.c index 27f8020d7..7bafbd52c 100644 --- a/src/lxc/tools/lxc_wait.c +++ b/src/lxc/tools/lxc_wait.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -14,7 +13,6 @@ #include "lxc.h" #include "arguments.h" -#include "config.h" #include "log.h" lxc_log_define(lxc_wait, lxc);