[10/11] libctf: add some missing #includes.

Message ID 20191216225357.87247-11-nick.alcock@oracle.com
State New
Headers show
Series
  • libctf: various portability fixes and small bugfixes
Related show

Commit Message

Nick Alcock Dec. 16, 2019, 10:53 p.m.
Causes warnings on (at least) recent FreeBSD.

libctf/
	* ctf-create.c: Include <unistd.h>.
	* ctf-open-bfd.c: Likewise.
---
 libctf/ChangeLog      | 5 +++++
 libctf/ctf-create.c   | 1 +
 libctf/ctf-open-bfd.c | 1 +
 3 files changed, 7 insertions(+)

-- 
2.24.1.242.gb57e918ca5

Patch

diff --git a/libctf/ChangeLog b/libctf/ChangeLog
index 5666eebc60..f172cbf864 100644
--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-12-16  Nick Alcock  <nick.alcock@oracle.com>
+
+	* ctf-create.c: Include <unistd.h>.
+	* ctf-open-bfd.c: Likewise.
+
 2019-12-16  Nick Alcock  <nick.alcock@oracle.com>
 
 	PR libctf/25120
diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c
index a63c213d33..b875075f50 100644
--- a/libctf/ctf-create.c
+++ b/libctf/ctf-create.c
@@ -21,6 +21,7 @@ 
 #include <sys/param.h>
 #include <assert.h>
 #include <string.h>
+#include <unistd.h>
 #include <zlib.h>
 
 #ifndef roundup
diff --git a/libctf/ctf-open-bfd.c b/libctf/ctf-open-bfd.c
index b40d3778d0..3264fc9a3e 100644
--- a/libctf/ctf-open-bfd.c
+++ b/libctf/ctf-open-bfd.c
@@ -25,6 +25,7 @@ 
 #include <errno.h>
 #include <string.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <elf.h>
 #include <bfd.h>
 #include "swap.h"