From 39f92650d33d038be5c5429e37d2d0c624b6ab38 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 5 Aug 2019 10:13:11 -0700 Subject: [PATCH] ls, tar: Guard inclusion of sys/sysmacros.h by absence of `major` definition Since musl 1.1.23, it too does not provide `major` and `minor` through sys/types.h, so instead include sys/sysmacros.h based on the absence of `major` rather than only on glibc. Thanks to Rich Felker for the suggestion. --- ls.c | 2 +- tar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ls.c b/ls.c index 7de15ac..aa95fef 100644 --- a/ls.c +++ b/ls.c @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ #include #include -#ifdef __GLIBC__ +#ifndef major #include #endif diff --git a/tar.c b/tar.c index fb0df45..f9158c2 100644 --- a/tar.c +++ b/tar.c @@ -2,7 +2,7 @@ #include #include #include -#ifdef __GLIBC__ +#ifndef major #include #endif