Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Apr 2018 01:35:06 +0000 (UTC)
From:      Benno Rice <benno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r332980 - in stable/11/usr.sbin/makefs: . cd9660 ffs
Message-ID:  <201804250135.w3P1Z6Xt084500@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804250135.w3P1Z6Xt084500>