chiark / gitweb /
[PATCH] fix problem where we were not looking at the BUS value.
[elogind.git] / udev.h
diff --git a/udev.h b/udev.h
index cdf1af4fc21ec58b51d2b25363a5aaebfdd889f1..89943074699daf8ef7cf690fb31aa89e7f5094ec 100644 (file)
--- a/udev.h
+++ b/udev.h
@@ -52,7 +52,7 @@ extern int log_message (int level, const char *format, ...)
 
 
 /* filenames for the config and database files */
-#define UDEV_DB                                "udev.tdb"
+#define UDEV_DB                                ".udev.tdb"
 #define UDEV_CONFIG_PERMISSION_FILE    "udev.permissions"
 #define UDEV_CONFIG_FILE               "udev.config"
 
@@ -68,8 +68,20 @@ struct udevice {
        int major;
        int minor;
        mode_t mode;
+
+       /* fields that help us in building strings */
+       unsigned char bus_id[SYSFS_NAME_LEN];
+       unsigned char callout_value[NAME_SIZE];
+       unsigned char kernel_number[NAME_SIZE];
+
 };
 
+#define strfieldcpy(to, from) \
+do { \
+       to[sizeof(to)-1] = '\0'; \
+       strncpy(to, from, sizeof(to)-1); \
+} while (0)
+
 extern int udev_add_device(char *path, char *subsystem);
 extern int udev_remove_device(char *path, char *subsystem);
 
@@ -83,4 +95,3 @@ extern char udev_config_permission_filename[PATH_MAX+NAME_MAX];
 extern char udev_config_filename[PATH_MAX+NAME_MAX];
 
 #endif
-