chiark / gitweb /
[PATCH] namedev.c comments + debug patch
[elogind.git] / namedev.c
index c21a5be7ad53549ba086b577de84b946d6bbf0bf..d049349f22b7923e43581d413b715f3a8ebae634 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -197,7 +197,6 @@ static int get_pair(char **orig_string, char **left, char **right)
 
 static int namedev_init_config(void)
 {
-       char filename[255];
        char line[255];
        char *temp;
        char *temp2;
@@ -206,11 +205,10 @@ static int namedev_init_config(void)
        int retval = 0;
        struct config_device dev;
 
-       strcpy(filename, UDEV_CONFIG_DIR NAMEDEV_CONFIG_FILE);
-       dbg("opening %s to read as permissions config", filename);
-       fd = fopen(filename, "r");
+       dbg("opening %s to read as config", udev_config_filename);
+       fd = fopen(udev_config_filename, "r");
        if (fd == NULL) {
-               dbg("Can't open %s", filename);
+               dbg("Can't open %s", udev_config_filename);
                return -ENODEV;
        }
 
@@ -394,7 +392,6 @@ exit:
 
 static int namedev_init_permissions(void)
 {
-       char filename[255];
        char line[255];
        char *temp;
        char *temp2;
@@ -402,11 +399,10 @@ static int namedev_init_permissions(void)
        int retval = 0;
        struct config_device dev;
 
-       strcpy(filename, UDEV_CONFIG_DIR NAMEDEV_CONFIG_PERMISSION_FILE);
-       dbg("opening %s to read as permissions config", filename);
-       fd = fopen(filename, "r");
+       dbg("opening %s to read as permissions config", udev_config_permission_filename);
+       fd = fopen(udev_config_permission_filename, "r");
        if (fd == NULL) {
-               dbg("Can't open %s", filename);
+               dbg("Can't open %s", udev_config_permission_filename);
                return -ENODEV;
        }
 
@@ -568,7 +564,7 @@ static int get_attr(struct sysfs_class_device *class_dev, struct device_attr *at
                        if (tmpattr)
                                goto label_found;
 
-                       /* look in the class device device directory if present */
+                       /* look in the class device directory if present */
                        if (class_dev->sysdevice) {
                                tmpattr = sysfs_get_classdev_attr(class_dev, dev->sysfs_file);
                                if (tmpattr)
@@ -601,7 +597,7 @@ static int get_attr(struct sysfs_class_device *class_dev, struct device_attr *at
                                        if (tmpattr) 
                                                goto label_found;
 
-                                       /* look in the class device device directory if present */
+                                       /* look in the class device directory if present */
                                        if (class_dev_parent->sysdevice) {
                                                tmpattr = sysfs_get_classdev_attr(class_dev_parent, dev->sysfs_file);
                                                if (tmpattr)