Skip to content

Commit

Permalink
tree-wide: fix includes to fix bionic builds
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Sep 26, 2018
1 parent a3aba11 commit d38dd64
Show file tree
Hide file tree
Showing 108 changed files with 513 additions and 323 deletions.
5 changes: 4 additions & 1 deletion src/lxc/af_unix.c
Expand Up @@ -20,8 +20,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
Expand All @@ -33,6 +35,7 @@
#include <sys/syscall.h>
#include <sys/un.h>

#include "config.h"
#include "log.h"
#include "utils.h"

Expand Down
1 change: 0 additions & 1 deletion src/lxc/api_extensions.h
Expand Up @@ -20,7 +20,6 @@
#ifndef __LXC_API_EXTENSIONS_H
#define __LXC_API_EXTENSIONS_H

#include "config.h"
#include <stdio.h>
#include <stdlib.h>

Expand Down
4 changes: 3 additions & 1 deletion src/lxc/attach.c
Expand Up @@ -21,7 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
Expand Down
7 changes: 4 additions & 3 deletions src/lxc/caps.c
Expand Up @@ -21,9 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <limits.h>
#include <fcntl.h>
Expand All @@ -32,6 +32,7 @@
#include <sys/prctl.h>

#include "caps.h"
#include "config.h"
#include "log.h"
#include "macro.h"

Expand Down
3 changes: 2 additions & 1 deletion src/lxc/caps.h
Expand Up @@ -24,9 +24,10 @@
#ifndef __LXC_CAPS_H
#define __LXC_CAPS_H

#include "config.h"
#include <stdbool.h>

#include "config.h"

#if HAVE_LIBCAP
#include <linux/types.h> /* workaround for libcap < 2.17 bug */
#include <sys/capability.h>
Expand Down
12 changes: 7 additions & 5 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -34,26 +34,28 @@
* a comman-separated list of controllers.
*/

#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <grp.h>
#include <linux/kdev_t.h>
#include <linux/types.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <linux/kdev_t.h>
#include <linux/types.h>
#include <sys/types.h>
#include <unistd.h>

#include "caps.h"
#include "cgroup.h"
#include "cgroup_utils.h"
#include "commands.h"
#include "conf.h"
#include "config.h"
#include "log.h"
#include "macro.h"
#include "storage/storage.h"
Expand Down
6 changes: 5 additions & 1 deletion src/lxc/cgroups/cgroup.c
Expand Up @@ -21,13 +21,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <unistd.h>

#include "cgroup.h"
#include "conf.h"
#include "config.h"
#include "initutils.h"
#include "log.h"
#include "start.h"
Expand Down
7 changes: 5 additions & 2 deletions src/lxc/cgroups/cgroup_utils.c
Expand Up @@ -22,14 +22,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "cgroup_utils.h"
#include "config.h"
#include "macro.h"
#include "utils.h"

int get_cgroup_version(char *line)
Expand Down
5 changes: 4 additions & 1 deletion src/lxc/cmd/lxc_init.c
Expand Up @@ -21,7 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
Expand All @@ -40,6 +42,7 @@
#include <lxc/version.h>

#include "compiler.h"
#include "config.h"
#include "error.h"
#include "initutils.h"
#include "log.h"
Expand Down
5 changes: 4 additions & 1 deletion src/lxc/cmd/lxc_monitord.c
Expand Up @@ -21,7 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
Expand All @@ -43,6 +45,7 @@
#include <lxc/lxccontainer.h>

#include "af_unix.h"
#include "config.h"
#include "log.h"
#include "mainloop.h"
#include "monitor.h"
Expand Down
20 changes: 11 additions & 9 deletions src/lxc/cmd/lxc_user_nic.c
Expand Up @@ -17,33 +17,35 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#define _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <alloca.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <sched.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/sockios.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <pwd.h>
#include <sched.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

#include "config.h"
#include "log.h"
Expand Down
6 changes: 4 additions & 2 deletions src/lxc/cmd/lxc_usernsexec.c
Expand Up @@ -22,8 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
Expand All @@ -42,6 +43,7 @@
#include <unistd.h>

#include "conf.h"
#include "config.h"
#include "list.h"
#include "log.h"
#include "macro.h"
Expand Down
8 changes: 5 additions & 3 deletions src/lxc/commands.c
Expand Up @@ -21,8 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "config.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <caps.h>
#include <errno.h>
#include <fcntl.h>
Expand All @@ -31,16 +32,17 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>

#include "af_unix.h"
#include "cgroup.h"
#include "commands.h"
#include "commands_utils.h"
#include "conf.h"
#include "config.h"
#include "confile.h"
#include "log.h"
#include "lxc.h"
Expand Down
9 changes: 6 additions & 3 deletions src/lxc/commands_utils.c
Expand Up @@ -17,22 +17,25 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#define _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#define __STDC_FORMAT_MACROS /* Required for PRIu64 to work. */
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>

#include "af_unix.h"
#include "commands.h"
#include "commands_utils.h"
#include "initutils.h"
#include "config.h"
#include "file_utils.h"
#include "initutils.h"
#include "log.h"
#include "lxclock.h"
#include "monitor.h"
Expand Down
3 changes: 3 additions & 0 deletions src/lxc/compiler.h
Expand Up @@ -20,6 +20,9 @@
#ifndef __LXC_COMPILER_H
#define __LXC_COMPILER_H

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <sys/cdefs.h>

#include "config.h"
Expand Down
51 changes: 26 additions & 25 deletions src/lxc/conf.c
Expand Up @@ -21,10 +21,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#define _GNU_SOURCE
#include "config.h"
#include "confile.h"

#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#include <arpa/inet.h>
#include <dirent.h>
#include <errno.h>
Expand Down Expand Up @@ -55,6 +54,29 @@
#include <time.h>
#include <unistd.h>

#include "af_unix.h"
#include "caps.h"
#include "cgroup.h"
#include "conf.h"
#include "config.h"
#include "confile.h"
#include "confile_utils.h"
#include "error.h"
#include "log.h"
#include "lsm/lsm.h"
#include "lxclock.h"
#include "lxcseccomp.h"
#include "macro.h"
#include "namespace.h"
#include "network.h"
#include "parse.h"
#include "ringbuf.h"
#include "start.h"
#include "storage.h"
#include "storage/overlay.h"
#include "terminal.h"
#include "utils.h"

#ifdef MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#endif
Expand Down Expand Up @@ -91,27 +113,6 @@
#include <../include/prlimit.h>
#endif

#include "af_unix.h"
#include "caps.h"
#include "cgroup.h"
#include "conf.h"
#include "confile_utils.h"
#include "error.h"
#include "log.h"
#include "lsm/lsm.h"
#include "lxclock.h"
#include "lxcseccomp.h"
#include "macro.h"
#include "namespace.h"
#include "network.h"
#include "parse.h"
#include "ringbuf.h"
#include "start.h"
#include "storage.h"
#include "storage/overlay.h"
#include "terminal.h"
#include "utils.h"

lxc_log_define(conf, lxc);

/* The lxc_conf of the container currently being worked on in an API call.
Expand Down

0 comments on commit d38dd64

Please sign in to comment.