aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/mtree.c
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2018-01-16 21:43:46 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2018-01-16 21:43:46 +0000
commit5f40118235b74deaed9b9d9054756b9bf5b52128 (patch)
treeec6168d8d6d8554bfcf2eeeb21ff2e8b08c30344 /usr.sbin/makefs/mtree.c
parentebe45c64a040a2a5d21c3c78117cb35398c7029d (diff)
downloadsrc-5f40118235b74deaed9b9d9054756b9bf5b52128.tar.gz
src-5f40118235b74deaed9b9d9054756b9bf5b52128.zip
Allow xinstall and makefs to be crossbuilt on Linux and Mac
I need these tools in order to install the crossbuilt FreeBSD and create a disk image. Linux does not have a st_flags in struct stat so unfortunately I need a bunch of ugly ifdefs. The resulting binaries allow me to sucessfully install a MIPS64 world and create a disk-image that boots. Reviewed By: brooks, bdrewery, emaste Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13307
Notes
Notes: svn path=/head/; revision=328064
Diffstat (limited to 'usr.sbin/makefs/mtree.c')
-rw-r--r--usr.sbin/makefs/mtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
index 181a695bcb31..2bcdd6c82254 100644
--- a/usr.sbin/makefs/mtree.c
+++ b/usr.sbin/makefs/mtree.c
@@ -25,6 +25,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -532,11 +536,13 @@ read_mtree_keywords(FILE *fp, fsnode *node)
break;
}
flset = flclr = 0;
+#if HAVE_STRUCT_STAT_ST_FLAGS
if (!strtofflags(&value, &flset, &flclr)) {
st->st_flags &= ~flclr;
st->st_flags |= flset;
} else
error = errno;
+#endif
} else
error = ENOSYS;
break;