core: add missing include
authorBartosz Golaszewski <bartekgola@gmail.com>
Wed, 7 Nov 2018 15:55:52 +0000 (16:55 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Wed, 7 Nov 2018 15:55:52 +0000 (16:55 +0100)
Not including <sys/sysmacros.h> causes the following error on ARM:

core.c: In function ‘is_gpiochip_cdev’:
core.c:116:4: warning: implicit declaration of function ‘major’ [-Wimplicit-function-declaration]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
    ^~~~~
core.c:116:28: warning: implicit declaration of function ‘minor’; did you mean ‘mknod’? [-Wimplicit-function-declaration]
    major(statbuf.st_rdev), minor(statbuf.st_rdev));
                            ^~~~~
                            mknod

It wasn't spotted earlier since it builds fine on x86-64. Add the
missing include.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/core.c

index 1902639a45db814b1a512aceb11293aaf2bfe2fe..4f273e3ec57a1dc17defdb692eb315c7e05a5a2a 100644 (file)
@@ -19,6 +19,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 #include <linux/gpio.h>
 
 enum {