f3aa4b156360ce4a18e4a3897f883b663771ba24.patch (1669B)
1 From f3aa4b156360ce4a18e4a3897f883b663771ba24 Mon Sep 17 00:00:00 2001 2 From: Michael Forney <mforney@mforney.org> 3 Date: Mon, 5 Aug 2019 15:45:17 -0700 4 Subject: [PATCH] Include sys/sysmacros.h when major is not defined in 5 sys/types.h 6 7 --- 8 libutil/tty.c | 5 ++++- 9 mknod.c | 3 +++ 10 mountpoint.c | 3 +++ 11 stat.c | 3 +++ 12 4 files changed, 13 insertions(+), 1 deletion(-) 13 14 diff --git a/libutil/tty.c b/libutil/tty.c 15 index bceb01e..f56388e 100644 16 --- a/libutil/tty.c 17 +++ b/libutil/tty.c 18 @@ -1,6 +1,9 @@ 19 /* See LICENSE file for copyright and license details. */ 20 -#include <sys/types.h> 21 #include <sys/stat.h> 22 +#include <sys/types.h> 23 +#ifndef major 24 +#include <sys/sysmacros.h> 25 +#endif 26 27 #include <fcntl.h> 28 #include <dirent.h> 29 diff --git a/mknod.c b/mknod.c 30 index 8de35c7..9dbede7 100644 31 --- a/mknod.c 32 +++ b/mknod.c 33 @@ -1,6 +1,9 @@ 34 /* See LICENSE file for copyright and license details. */ 35 #include <sys/stat.h> 36 #include <sys/types.h> 37 +#ifndef major 38 +#include <sys/sysmacros.h> 39 +#endif 40 41 #include <fcntl.h> 42 #include <stdio.h> 43 diff --git a/mountpoint.c b/mountpoint.c 44 index 8f205a2..726cc80 100644 45 --- a/mountpoint.c 46 +++ b/mountpoint.c 47 @@ -1,6 +1,9 @@ 48 /* See LICENSE file for copyright and license details. */ 49 #include <sys/stat.h> 50 #include <sys/types.h> 51 +#ifndef major 52 +#include <sys/sysmacros.h> 53 +#endif 54 55 #include <mntent.h> 56 #include <stdio.h> 57 diff --git a/stat.c b/stat.c 58 index 220a659..3a6569b 100644 59 --- a/stat.c 60 +++ b/stat.c 61 @@ -1,6 +1,9 @@ 62 /* See LICENSE file for copyright and license details. */ 63 #include <sys/stat.h> 64 #include <sys/types.h> 65 +#ifndef major 66 +#include <sys/sysmacros.h> 67 +#endif 68 69 #include <inttypes.h> 70 #include <stdio.h>