]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
bdev: include own getline function in bdev.h 1103/head
authorChristian Brauner <cbrauner@suse.de>
Wed, 27 Jul 2016 16:07:34 +0000 (18:07 +0200)
committerChristian Brauner <cbrauner@suse.de>
Wed, 27 Jul 2016 16:10:48 +0000 (18:10 +0200)
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 <cbrauner@suse.de>
src/lxc/bdev/bdev.h

index 3f21e840435de10e2b51ee8752d71d53e6d54cc3..1ffb590aa1ada08d220c8fdd64bbc15312e136e2 100644 (file)
 
 #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