From 8c2e2e8f5319f5e66ca5920f50e835f3f31a908f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 27 Jul 2016 18:07:34 +0200 Subject: [PATCH] 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 --- src/lxc/bdev/bdev.h | 7 +++++++ 1 file changed, 7 insertions(+) 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