chiark / gitweb /
rename major/minor variable to maj/min to avoid warning
[elogind.git] / udev_db.c
index 86a3ea7a39bb6d20f6c5f51feae1b4c5fe60fdbf..797d0eeffbf4c036f3f64ada553e5fcafdde2020 100644 (file)
--- a/udev_db.c
+++ b/udev_db.c
@@ -29,6 +29,8 @@
 #include <string.h>
 #include <errno.h>
 #include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 
 #include "udev.h"
 
@@ -120,7 +122,7 @@ int udev_db_get_device(struct udevice *udev, const char *devpath)
        struct stat stats;
        char filename[PATH_SIZE];
        char line[PATH_SIZE];
-       unsigned int major, minor;
+       unsigned int maj, min;
        char *bufline;
        char *buf;
        size_t bufsize;
@@ -174,8 +176,8 @@ int udev_db_get_device(struct udevice *udev, const char *devpath)
                                count = sizeof(line);
                        memcpy(line, &bufline[2], count-2);
                        line[count-2] = '\0';
-                       sscanf(line, "%u:%u", &major, &minor);
-                       udev->devt = makedev(major, minor);
+                       sscanf(line, "%u:%u", &maj, &min);
+                       udev->devt = makedev(maj, min);
                        break;
                case 'S':
                        if (count > sizeof(line))