From 7a435f9abc33985e92efc6e38fc89fd5ce7b8bad Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 29 Jan 2014 14:23:50 +0000 Subject: [PATCH] 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 Acked-by: Serge E. Hallyn --- src/lxc/lxc_snapshot.c | 1 + src/lxc/lxc_usernsexec.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lxc/lxc_snapshot.c b/src/lxc/lxc_snapshot.c index 9a8f6a443..a49e8d737 100644 --- a/src/lxc/lxc_snapshot.c +++ b/src/lxc/lxc_snapshot.c @@ -16,6 +16,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" #include #include diff --git a/src/lxc/lxc_usernsexec.c b/src/lxc/lxc_usernsexec.c index 83357259d..b82bcf8da 100644 --- a/src/lxc/lxc_usernsexec.c +++ b/src/lxc/lxc_usernsexec.c @@ -21,6 +21,7 @@ * 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" #include #include @@ -39,7 +40,6 @@ #include #include -#include "config.h" #include "namespace.h" #include "utils.h"