summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2003-07-20 14:12:13 +0000
committerlukem <lukem@NetBSD.org>2003-07-20 14:12:13 +0000
commit5885a35ae335f9ba90b24cd20c5eca856493a48e (patch)
tree82bd8a269fffa1a16fa1e4ca6733bd5a84727920 /usr.bin
parentfe7ef256ea2446f614c5f24de72153a80904952f (diff)
first attempt at making this a HOSTPROG
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/stat/Makefile5
-rw-r--r--usr.bin/stat/stat.c14
2 files changed, 15 insertions, 4 deletions
diff --git a/usr.bin/stat/Makefile b/usr.bin/stat/Makefile
index 60756261a40..c15098e9ddb 100644
--- a/usr.bin/stat/Makefile
+++ b/usr.bin/stat/Makefile
@@ -1,7 +1,10 @@
-# $NetBSD: Makefile,v 1.3 2002/07/26 14:16:37 atatat Exp $
+# $NetBSD: Makefile,v 1.4 2003/07/20 14:12:13 lukem Exp $
PROG= stat
+
+.if defined(HOSTPROG)
LINKS= ${BINDIR}/stat ${BINDIR}/readlink
MLINKS= stat.1 readlink.1
+.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c
index 85d00e40b2d..1536685d91c 100644
--- a/usr.bin/stat/stat.c
+++ b/usr.bin/stat/stat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stat.c,v 1.10 2003/05/08 13:05:38 atatat Exp $ */
+/* $NetBSD: stat.c,v 1.11 2003/07/20 14:12:13 lukem Exp $ */
/*
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,8 +37,14 @@
*/
#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("$NetBSD: stat.c,v 1.10 2003/05/08 13:05:38 atatat Exp $");
+#if defined(__RCSID) && !defined(lint)
+__RCSID("$NetBSD: stat.c,v 1.11 2003/07/20 14:12:13 lukem Exp $");
+#endif
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#else
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
#endif
#include <sys/types.h>
@@ -669,6 +675,7 @@ format1(const struct stat *st,
if (ofmt == 0)
ofmt = FMTF_UNSIGNED;
break;
+#if HAVE_STRUCT_STAT_ST_FLAGS
case SHOW_st_flags:
small = (sizeof(st->st_flags) == 4);
data = st->st_flags;
@@ -677,6 +684,7 @@ format1(const struct stat *st,
if (ofmt == 0)
ofmt = FMTF_UNSIGNED;
break;
+#endif
case SHOW_st_gen:
small = (sizeof(st->st_gen) == 4);
data = st->st_gen;