Author: benno
Date: Wed Apr 25 01:35:06 2018
New Revision: 332980
URL: https://svnweb.freebsd.org/changeset/base/332980

Log:
  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.

Modified:
  stable/11/usr.sbin/makefs/cd9660.c
  stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c
  stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c
  stable/11/usr.sbin/makefs/ffs/ffs_bswap.c
  stable/11/usr.sbin/makefs/ffs/ffs_subr.c
  stable/11/usr.sbin/makefs/mtree.c
  stable/11/usr.sbin/makefs/walk.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/makefs/cd9660.c
==============================================================================
--- stable/11/usr.sbin/makefs/cd9660.c  Wed Apr 25 01:30:29 2018        
(r332979)
+++ stable/11/usr.sbin/makefs/cd9660.c  Wed Apr 25 01:35:06 2018        
(r332980)
@@ -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"

Modified: stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c
==============================================================================
--- stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c        Wed Apr 25 
01:30:29 2018        (r332979)
+++ stable/11/usr.sbin/makefs/cd9660/cd9660_archimedes.c        Wed Apr 25 
01:35:06 2018        (r332980)
@@ -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"

Modified: stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c
==============================================================================
--- stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c     Wed Apr 25 01:30:29 
2018        (r332979)
+++ stable/11/usr.sbin/makefs/cd9660/iso9660_rrip.c     Wed Apr 25 01:35:06 
2018        (r332980)
@@ -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 *);

Modified: stable/11/usr.sbin/makefs/ffs/ffs_bswap.c
==============================================================================
--- stable/11/usr.sbin/makefs/ffs/ffs_bswap.c   Wed Apr 25 01:30:29 2018        
(r332979)
+++ stable/11/usr.sbin/makefs/ffs/ffs_bswap.c   Wed Apr 25 01:35:06 2018        
(r332980)
@@ -40,17 +40,18 @@ __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]

Modified: stable/11/usr.sbin/makefs/ffs/ffs_subr.c
==============================================================================
--- stable/11/usr.sbin/makefs/ffs/ffs_subr.c    Wed Apr 25 01:30:29 2018        
(r332979)
+++ stable/11/usr.sbin/makefs/ffs/ffs_subr.c    Wed Apr 25 01:35:06 2018        
(r332980)
@@ -35,6 +35,7 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/types.h>
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>

Modified: stable/11/usr.sbin/makefs/mtree.c
==============================================================================
--- stable/11/usr.sbin/makefs/mtree.c   Wed Apr 25 01:30:29 2018        
(r332979)
+++ stable/11/usr.sbin/makefs/mtree.c   Wed Apr 25 01:35:06 2018        
(r332980)
@@ -46,10 +46,15 @@ __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')

Modified: stable/11/usr.sbin/makefs/walk.c
==============================================================================
--- stable/11/usr.sbin/makefs/walk.c    Wed Apr 25 01:30:29 2018        
(r332979)
+++ stable/11/usr.sbin/makefs/walk.c    Wed Apr 25 01:35:06 2018        
(r332980)
@@ -42,6 +42,7 @@
 __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
+#include <sys/time.h>
 
 #include <assert.h>
 #include <errno.h>
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to