From: Christian Brauner Date: Wed, 27 Jul 2016 16:07:34 +0000 (+0200) Subject: bdev: include own getline function in bdev.h X-Git-Tag: lxc-2.1.0~373^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1103%2Fhead;p=thirdparty%2Flxc.git bdev: include own getline function in bdev.h Fixes android build error: bdev/bdev.c: In function 'detect_fs': bdev/bdev.c:686:2: error: implicit declaration of function 'getline' [-Werror=implicit-function-declaration] while (getline(&line, &linelen, f) != -1) { ^ Signed-off-by: Christian Brauner --- diff --git a/src/lxc/bdev/bdev.h b/src/lxc/bdev/bdev.h index 3f21e8404..1ffb590aa 100644 --- a/src/lxc/bdev/bdev.h +++ b/src/lxc/bdev/bdev.h @@ -33,6 +33,13 @@ #include "config.h" +/* Define getline() if missing from the C library */ +#ifndef HAVE_GETLINE +#ifdef HAVE_FGETLN +#include <../../include/getline.h> +#endif +#endif + /* define constants if the kernel/glibc headers don't define them */ #ifndef MS_DIRSYNC #define MS_DIRSYNC 128