if (*str[0] == '{') {
pos = strchr(*str, '}');
if (pos == NULL) {
- dbg("missing closing brace for format");
+ err("missing closing brace for format");
return NULL;
}
pos[0] = '\0';
dbg("format length=%i", num);
return num;
} else {
- dbg("format parsing error '%s'", *str);
+ err("format parsing error '%s'", *str);
}
}
return -1;
cpos++;
}
if (i > 0) {
- dbg("requested part of result string not found");
+ err("requested part of result string not found");
break;
}
strlcpy(temp2, cpos, sizeof(temp2));
}
tmpattr = find_sysfs_attribute(class_dev, sysfs_device, attr);
if (tmpattr == NULL) {
- dbg("sysfa attribute '%s' not found", attr);
+ dbg("sysfs attribute '%s' not found", attr);
break;
}
/* strip trailing whitespace of matching value */
dbg("substitute udev_root '%s'", udev_root);
break;
default:
- dbg("unknown substitution type '%%%c'", c);
+ err("unknown substitution type '%%%c'", c);
break;
}
/* truncate to specified length */
retval = pipe(fds);
if (retval != 0) {
- dbg("pipe failed");
+ err("pipe failed");
return -1;
}
info(KEY_PROGRAM " execution of '%s' failed", path);
exit(1);
case -1:
- dbg("fork failed");
+ err("fork of '%s' failed", path);
return -1;
default:
/* parent reads from fds[0] */
i += count;
if (i >= len-1) {
- dbg("result len %d too short", len);
+ err("result len %d too short", len);
retval = -1;
break;
}
}
if (count < 0) {
- dbg("read failed with '%s'", strerror(errno));
+ err("read failed with '%s'", strerror(errno));
retval = -1;
}
if (rule->driver[0] != '\0') {
if (sysfs_device == NULL) {
dbg("device has no sysfs_device");
- goto try_parent;
+ goto exit;
}
dbg("check for " KEY_DRIVER " rule->driver='%s' sysfs_device->driver_name='%s'",
rule->driver, sysfs_device->driver_name);
if (rule->bus[0] != '\0') {
if (sysfs_device == NULL) {
dbg("device has no sysfs_device");
- goto try_parent;
+ goto exit;
}
dbg("check for " KEY_BUS " rule->bus='%s' sysfs_device->bus='%s'",
rule->bus, sysfs_device->bus);
if (rule->id[0] != '\0') {
if (sysfs_device == NULL) {
dbg("device has no sysfs_device");
- goto try_parent;
+ goto exit;
}
dbg("check " KEY_ID);
if (strcmp_pattern(rule->id, sysfs_device->bus_id) != 0) {
sysfs_device = sysfs_get_device_parent(sysfs_device);
if (sysfs_device == NULL)
goto exit;
- dbg("sysfs_device->path='%s'", sysfs_device->path);
- dbg("sysfs_device->bus_id='%s'", sysfs_device->bus_id);
+ dbg("look at sysfs_device->path='%s'", sysfs_device->path);
+ dbg("look at sysfs_device->bus_id='%s'", sysfs_device->bus_id);
}
/* execute external program */
next = strchr(temp, ' ');
while (next) {
next[0] = '\0';
- dbg("add symlink '%s'", pos);
+ info("add symlink '%s'", pos);
name_list_add(&udev->symlink_list, pos, 0);
pos = &next[1];
next = strchr(pos, ' ');
}
- dbg("add symlink '%s'", pos);
+ info("add symlink '%s'", pos);
name_list_add(&udev->symlink_list, pos, 0);
}
if (udev->name[0] == '\0') {
/* no rule matched, so we use the kernel name */
strlcpy(udev->name, udev->kernel_name, sizeof(udev->name));
- dbg("no rule found, use kernel name '%s'", udev->name);
+ info("no rule found, use kernel name '%s'", udev->name);
}
if (udev->tmp_node[0] != '\0') {