summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbenno <benno@FreeBSD.org>2018-04-25 01:35:06 +0000
committerbenno <benno@FreeBSD.org>2018-04-25 01:35:06 +0000
commitf0b95adef4bb69f0417b511389c3f8a854f9702d (patch)
tree808e517b56516dfc8f788746e6df4f8dc1902ac5 /usr.sbin
parent54d2cd1e8c480d6d6240cd79e15a96723a8c7d9b (diff)
downloadFreeBSD-src-f0b95adef4bb69f0417b511389c3f8a854f9702d.zip
FreeBSD-src-f0b95adef4bb69f0417b511389c3f8a854f9702d.tar.gz
MFC r307927
Be more precise when including headers so that we're less likely to depend on namespace pollution and as such become more portable. This means including headers like <sys/types.h> or <stdlib.h>, but also making sure we include system/host headers before local headers. While here: define ENOATTR as ENOMSG in mtree.c. There is no ENOATTR on Linux. With this, makefs is ready for compilation on macOS and Linux. Sponsored by: iXsystems, Inc.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/makefs/cd9660.c5
-rw-r--r--usr.sbin/makefs/cd9660/cd9660_archimedes.c2
-rw-r--r--usr.sbin/makefs/cd9660/iso9660_rrip.c12
-rw-r--r--usr.sbin/makefs/ffs/ffs_bswap.c9
-rw-r--r--usr.sbin/makefs/ffs/ffs_subr.c1
-rw-r--r--usr.sbin/makefs/mtree.c5
-rw-r--r--usr.sbin/makefs/walk.c1
7 files changed, 24 insertions, 11 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index edec32c..dc1f6ad 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -100,10 +100,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <string.h>
-#include <ctype.h>
#include <sys/param.h>
#include <sys/queue.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#include "makefs.h"
#include "cd9660.h"
diff --git a/usr.sbin/makefs/cd9660/cd9660_archimedes.c b/usr.sbin/makefs/cd9660/cd9660_archimedes.c
index 2c386ee..47bfacd 100644
--- a/usr.sbin/makefs/cd9660/cd9660_archimedes.c
+++ b/usr.sbin/makefs/cd9660/cd9660_archimedes.c
@@ -42,9 +42,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include <sys/types.h>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "makefs.h"
diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c
index 5008d73..de6f80e 100644
--- a/usr.sbin/makefs/cd9660/iso9660_rrip.c
+++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c
@@ -37,14 +37,16 @@
* defined in iso9660_rrip.h
*/
-#include "makefs.h"
-#include "cd9660.h"
-#include "iso9660_rrip.h"
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <sys/queue.h>
+#include <sys/types.h>
#include <stdio.h>
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+#include "makefs.h"
+#include "cd9660.h"
+#include "iso9660_rrip.h"
static void cd9660_rrip_initialize_inode(cd9660node *);
static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *);
diff --git a/usr.sbin/makefs/ffs/ffs_bswap.c b/usr.sbin/makefs/ffs/ffs_bswap.c
index 7ee73cd..336f827 100644
--- a/usr.sbin/makefs/ffs/ffs_bswap.c
+++ b/usr.sbin/makefs/ffs/ffs_bswap.c
@@ -40,18 +40,19 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#endif
-#include <ufs/ufs/dinode.h>
-#include "ffs/ufs_bswap.h"
-#include <ufs/ffs/fs.h>
-
#if !defined(_KERNEL)
#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define panic(x) printf("%s\n", (x)), abort()
#endif
+#include <ufs/ufs/dinode.h>
+#include "ffs/ufs_bswap.h"
+#include <ufs/ffs/fs.h>
+
#define fs_old_postbloff fs_spare5[0]
#define fs_old_rotbloff fs_spare5[1]
#define fs_old_postbl_start fs_maxbsize
diff --git a/usr.sbin/makefs/ffs/ffs_subr.c b/usr.sbin/makefs/ffs/ffs_subr.c
index b55174d..ddf4d2e 100644
--- a/usr.sbin/makefs/ffs/ffs_subr.c
+++ b/usr.sbin/makefs/ffs/ffs_subr.c
@@ -35,6 +35,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/types.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
index fd2722d..ed05d12 100644
--- a/usr.sbin/makefs/mtree.c
+++ b/usr.sbin/makefs/mtree.c
@@ -46,11 +46,16 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <string.h>
#include <strings.h>
+#include <time.h>
#include <unistd.h>
#include <vis.h>
#include "makefs.h"
+#ifndef ENOATTR
+#define ENOATTR ENOMSG
+#endif
+
#define IS_DOT(nm) ((nm)[0] == '.' && (nm)[1] == '\0')
#define IS_DOTDOT(nm) ((nm)[0] == '.' && (nm)[1] == '.' && (nm)[2] == '\0')
diff --git a/usr.sbin/makefs/walk.c b/usr.sbin/makefs/walk.c
index f31c549..b59d925 100644
--- a/usr.sbin/makefs/walk.c
+++ b/usr.sbin/makefs/walk.c
@@ -42,6 +42,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/time.h>
#include <assert.h>
#include <errno.h>
OpenPOWER on IntegriCloud