diff mbox

[i-g-t] Fix compilation on some distros

Message ID 20170927230827.25927-1-james.ausmus@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

James Ausmus Sept. 27, 2017, 11:08 p.m. UTC
Some distros (such as Gentoo) are removing the include of
sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in
files where we use the minor() and major() functions.

Signed-off-by: James Ausmus <james.ausmus@intel.com>
---
 lib/igt_debugfs.c | 1 +
 lib/igt_sysfs.c   | 1 +
 tools/aubdump.c   | 1 +
 3 files changed, 3 insertions(+)

Comments

Petri Latvala Sept. 28, 2017, 8:40 a.m. UTC | #1
On Wed, Sep 27, 2017 at 04:08:27PM -0700, James Ausmus wrote:
> Some distros (such as Gentoo) are removing the include of
> sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in
> files where we use the minor() and major() functions.
> 
> Signed-off-by: James Ausmus <james.ausmus@intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>



> ---
>  lib/igt_debugfs.c | 1 +
>  lib/igt_sysfs.c   | 1 +
>  tools/aubdump.c   | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index 1e8c8cc3cd44..60b29e3a025a 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -25,6 +25,7 @@
>  #include <inttypes.h>
>  #include <sys/stat.h>
>  #include <sys/mount.h>
> +#include <sys/sysmacros.h>
>  #include <dirent.h>
>  #include <errno.h>
>  #include <stdio.h>
> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
> index 817678bc28ed..f4e306003b01 100644
> --- a/lib/igt_sysfs.c
> +++ b/lib/igt_sysfs.c
> @@ -24,6 +24,7 @@
>  
>  #include <inttypes.h>
>  #include <sys/stat.h>
> +#include <sys/sysmacros.h>
>  #include <sys/mount.h>
>  #include <errno.h>
>  #include <stdarg.h>
> diff --git a/tools/aubdump.c b/tools/aubdump.c
> index 78d183f49adc..ee4d99b06ed1 100644
> --- a/tools/aubdump.c
> +++ b/tools/aubdump.c
> @@ -30,6 +30,7 @@
>  #include <stdarg.h>
>  #include <fcntl.h>
>  #include <sys/types.h>
> +#include <sys/sysmacros.h>
>  #include <sys/stat.h>
>  #include <sys/ioctl.h>
>  #include <unistd.h>
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
James Ausmus Oct. 3, 2017, 11:38 p.m. UTC | #2
On Thu, Sep 28, 2017 at 1:40 AM, Petri Latvala <petri.latvala@intel.com> wrote:
> On Wed, Sep 27, 2017 at 04:08:27PM -0700, James Ausmus wrote:
>> Some distros (such as Gentoo) are removing the include of
>> sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in
>> files where we use the minor() and major() functions.
>>
>> Signed-off-by: James Ausmus <james.ausmus@intel.com>
>
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
>

Thanks for the review! Can you push? I don't have access rights.

Thanks!

-James

>
>
>> ---
>>  lib/igt_debugfs.c | 1 +
>>  lib/igt_sysfs.c   | 1 +
>>  tools/aubdump.c   | 1 +
>>  3 files changed, 3 insertions(+)
>>
>> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
>> index 1e8c8cc3cd44..60b29e3a025a 100644
>> --- a/lib/igt_debugfs.c
>> +++ b/lib/igt_debugfs.c
>> @@ -25,6 +25,7 @@
>>  #include <inttypes.h>
>>  #include <sys/stat.h>
>>  #include <sys/mount.h>
>> +#include <sys/sysmacros.h>
>>  #include <dirent.h>
>>  #include <errno.h>
>>  #include <stdio.h>
>> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
>> index 817678bc28ed..f4e306003b01 100644
>> --- a/lib/igt_sysfs.c
>> +++ b/lib/igt_sysfs.c
>> @@ -24,6 +24,7 @@
>>
>>  #include <inttypes.h>
>>  #include <sys/stat.h>
>> +#include <sys/sysmacros.h>
>>  #include <sys/mount.h>
>>  #include <errno.h>
>>  #include <stdarg.h>
>> diff --git a/tools/aubdump.c b/tools/aubdump.c
>> index 78d183f49adc..ee4d99b06ed1 100644
>> --- a/tools/aubdump.c
>> +++ b/tools/aubdump.c
>> @@ -30,6 +30,7 @@
>>  #include <stdarg.h>
>>  #include <fcntl.h>
>>  #include <sys/types.h>
>> +#include <sys/sysmacros.h>
>>  #include <sys/stat.h>
>>  #include <sys/ioctl.h>
>>  #include <unistd.h>
>> --
>> 2.14.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 1e8c8cc3cd44..60b29e3a025a 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -25,6 +25,7 @@ 
 #include <inttypes.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
+#include <sys/sysmacros.h>
 #include <dirent.h>
 #include <errno.h>
 #include <stdio.h>
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 817678bc28ed..f4e306003b01 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -24,6 +24,7 @@ 
 
 #include <inttypes.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <sys/mount.h>
 #include <errno.h>
 #include <stdarg.h>
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 78d183f49adc..ee4d99b06ed1 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -30,6 +30,7 @@ 
 #include <stdarg.h>
 #include <fcntl.h>
 #include <sys/types.h>
+#include <sys/sysmacros.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <unistd.h>