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.
master
Michael Forney 4 years ago
parent 7315b8686f
commit 39f92650d3

@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */
#include <sys/stat.h>
#include <sys/types.h>
#ifdef __GLIBC__
#ifndef major
#include <sys/sysmacros.h>
#endif

@ -2,7 +2,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef __GLIBC__
#ifndef major
#include <sys/sysmacros.h>
#endif

Loading…
Cancel
Save