serial,astlpc: only include unistd.h if we're using file IO
We currently include unistd.h for all astlpc.c and serial.c builds, but
we're only using it for read() & write().
This change moves the unistd include (which may not be available on all
platforms) to within the HAVE_FILEIO conditional.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reported-by: Jet Li <Jet.Li@ibm.com>
Change-Id: I7aaf46094f94269c681afc41a3092708c5137688
diff --git a/serial.c b/serial.c
index 781a9c1..3186a2d 100644
--- a/serial.c
+++ b/serial.c
@@ -4,13 +4,13 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef MCTP_HAVE_FILEIO
+#include <unistd.h>
#include <fcntl.h>
#else
static const size_t write(int fd, void *buf, size_t len)