[lxc-devel] [lxc/lxc] 37515e: Include poll.h instead of sys/poll.h

GitHub noreply at github.com
Wed Jan 29 16:16:02 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 37515ebdf0d75c018513d55b0fe172df3d1a3c46
      https://github.com/lxc/lxc/commit/37515ebdf0d75c018513d55b0fe172df3d1a3c46
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/commands.c
    M src/lxc/lxc_console.c
    M src/lxc/start.c

  Log Message:
  -----------
  Include poll.h instead of sys/poll.h

poll.h is defined in POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/functions/poll.html

This fixes a compile warning when building with musl libc:
In file included from start.c:46:0:
/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include <sys
/poll.h> to <poll.h> [-Werror=cpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 85dce4a5434281d50453a58b6be4351d4dfffbf6
      https://github.com/lxc/lxc/commit/85dce4a5434281d50453a58b6be4351d4dfffbf6
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/conf.h

  Log Message:
  -----------
  Use the standard 'unsigned int' instead or non-standard 'uint'

This fixes compile error when build with musl libc:
conf.h:92:2: error: unknown type name 'uint'
  uint   fmask;
  ^

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 65441ac9e57369e2ae31ada6998bffa0b1ae7511
      https://github.com/lxc/lxc/commit/65441ac9e57369e2ae31ada6998bffa0b1ae7511
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/log.h

  Log Message:
  -----------
  Include strings.h for strcasecmp

This fixes the following error with musl libc:
In file included from start.c:59:0:
log.h: In function 'lxc_log_priority_to_int':
log.h:136:2: error: implicit declaration of function 'strcasecmp' [-Werror=implicit-function-declaration]

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: f9870943ecdba3f9a8eeff2b31e3a878368f6566
      https://github.com/lxc/lxc/commit/f9870943ecdba3f9a8eeff2b31e3a878368f6566
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/monitor.h

  Log Message:
  -----------
  Include limits.h for NAME_MAX

This fixes compile error with musl libc:
In file included from start.c:66:0:
monitor.h:38:12: error: 'NAME_MAX' undeclared here (not in a function)
  char name[NAME_MAX+1];
      ^

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 47add7e5b6c917cd9ee572f9d9e1c5a8f3d9f2fb
      https://github.com/lxc/lxc/commit/47add7e5b6c917cd9ee572f9d9e1c5a8f3d9f2fb
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/network.c

  Log Message:
  -----------
  Don't include linux/if_bridge.h

Instead rely on struct ethhdr from net/ethernet.h

This fixes build error with musl libc:
In file included from /usr/include/linux/if_bridge.h:17:0,
           from network.c:47:
/usr/include/linux/if_ether.h:133:8: error: redefinition of 'struct ethhdr'
 struct ethhdr {
  ^
In file included from /usr/include/net/ethernet.h:10:0,
           from network.c:42:
/usr/include/netinet/if_ether.h:93:8: note: originally defined here
 struct ethhdr {
  ^

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 8b6d8b712b867ab352598ed4b73e80e54a8c915a
      https://github.com/lxc/lxc/commit/8b6d8b712b867ab352598ed4b73e80e54a8c915a
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M configure.ac
    M src/lxc/lxcutmp.c

  Log Message:
  -----------
  Check for non-posix utmpxname in configure

utmpx.h is specified in POSIX but utmpxname is not so we check for
utmpxname in configure script.

This fixes the following compile error with musl libc:
lxcutmp.c: In function 'utmp_get_runlevel':
lxcutmp.c:249:2: error: implicit declaration of function 'utmpxname' [-Werror=implicit-function-declaration]
  if (!access(path, F_OK) && !utmpxname(path))
    ^

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: d06245b81b736d46da1ce88b51287dede0c9e2d3
      https://github.com/lxc/lxc/commit/d06245b81b736d46da1ce88b51287dede0c9e2d3
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/af_unix.c
    M src/lxc/cgmanager.c
    M src/lxc/cgroup.c
    M src/lxc/conf.c
    M src/lxc/freezer.c
    M src/lxc/lxc_start.c
    M src/lxc/lxc_unshare.c
    M src/lxc/start.c

  Log Message:
  -----------
  Include config.h early for _GNU_SOURCE with musl libc

This fixes various compile errors when building with musl libc. For
example:

In file included from start.c:66:0:
monitor.h:38:12: error: 'NAME_MAX' undeclared here (not in a function)
  char name[NAME_MAX+1];
      ^
start.c: In function 'setup_signal_fd':
start.c:202:2: error: implicit declaration of function 'sigfillset' [-Werror=implicit-function-declaration]
  if (sigfillset(&mask) ||
  ^

...

In file included from freezer.c:36:0:
monitor.h:39:12: error: 'NAME_MAX' undeclared here (not in a function)
  char name[NAME_MAX+1];
      ^
...

In file included from cgroup.c:45:0:
conf.h:87:13: error: 'IFNAMSIZ' undeclared here (not in a function)
  char veth1[IFNAMSIZ]; /* needed for deconf */
       ^
cgroup.c: In function 'find_cgroup_subsystems':
cgroup.c:230:3: error: implicit declaration of function 'strdup' [-Werror=implicit-function-declaration]
   (*kernel_subsystems)[kernel_subsystems_count] = strdup(line);
   ^
...

In file included from conf.c:65:0:
conf.h:87:13: error: 'IFNAMSIZ' undeclared here (not in a function)
  char veth1[IFNAMSIZ]; /* needed for deconf */
       ^
In file included from conf.c:66:0:
conf.c: In function 'run_buffer':
log.h:263:9: error: implicit declaration of function 'strsignal' [-Werror=implicit-function-declaration]
  struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT;  \
   ^
...

af_unix.c: In function 'lxc_abstract_unix_send_credential':
af_unix.c:208:9: error: variable 'cred' has initializer but incomplete type
  struct ucred cred = {
   ^
af_unix.c:209:3: error: unknown field 'pid' specified in initializer
   .pid = getpid(),
   ^
af_unix.c:209:3: error: excess elements in struct initializer [-Werror]
af_unix.c:209:3: error: (near initialization for 'cred') [-Werror]
af_unix.c:210:3: error: unknown field 'uid' specified in initializer
   .uid = getuid(),
   ^
af_unix.c:210:3: error: excess elements in struct initializer [-Werror]
af_unix.c:210:3: error: (near initialization for 'cred') [-Werror]
af_unix.c:211:3: error: unknown field 'gid' specified in initializer
   .gid = getgid(),
   ^

and more...

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


  Commit: 7a435f9abc33985e92efc6e38fc89fd5ce7b8bad
      https://github.com/lxc/lxc/commit/7a435f9abc33985e92efc6e38fc89fd5ce7b8bad
  Author: Natanael Copa <ncopa at alpinelinux.org>
  Date:   2014-01-29 (Wed, 29 Jan 2014)

  Changed paths:
    M src/lxc/lxc_snapshot.c
    M src/lxc/lxc_usernsexec.c

  Log Message:
  -----------
  Include config.h early for _GNU_SOURCE with uClibc

This fixes the following compile errors with uClibc:

lxc_snapshot.c: In function 'print_file':
lxc_snapshot.c:71:2: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration]
  while (getline(&line, &sz, f) != -1) {
  ^
cc1: all warnings being treated as errors

lxc_usernsexec.c: In function 'read_default_map':
lxc_usernsexec.c:181:2: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration]
  while (getline(&line, &sz, fin) != -1) {
  ^
cc1: all warnings being treated as errors

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/565e571c8f88...7a435f9abc33


More information about the lxc-devel mailing list