aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-03-06 23:30:50 +0100
committerDuncaen <mail@duncano.de>2017-03-06 23:30:50 +0100
commitf775ceff014b779684d44542b467436b42106424 (patch)
tree7ca70441170eb0e23d1e03278c1415f7da5d8e32
parentf186a9030f522216363c7bfb93cbc8ac205a1bf3 (diff)
downloadlobase-f775ceff014b779684d44542b467436b42106424.tar.gz
usr.bin/stat: fix implicit functions warnings
-rw-r--r--usr.bin/stat/Makefile1
-rw-r--r--usr.bin/stat/stat.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/stat/Makefile b/usr.bin/stat/Makefile
index c720147..d8fb6f2 100644
--- a/usr.bin/stat/Makefile
+++ b/usr.bin/stat/Makefile
@@ -2,6 +2,5 @@
# $NetBSD: Makefile,v 1.7 2003/07/25 03:21:17 atatat Exp $
PROG= stat
-CPPFLAGS+=-D_XOPEN_SOURCE -D_GNU_SOURCE
include bsd.prog.mk
diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c
index 336da3a..5cb9bb6 100644
--- a/usr.bin/stat/stat.c
+++ b/usr.bin/stat/stat.c
@@ -30,7 +30,14 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#define _GNU_SOURCE
+#if defined(__linux__)
+# if !defined(_GNU_SOURCE)
+# define _GNU_SOURCE
+# endif
+# if !defined(_XOPEN_SOURCE)
+# define _XOPEN_SOURCE
+# endif
+#endif
#include <sys/types.h>
#include <sys/stat.h>