aboutsummaryrefslogtreecommitdiff
path: root/src/kerneldevice/mm-kernel-device-generic.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-11-08 23:22:48 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-11-09 10:50:26 +0100
commit73b44ea51b84e8c8259e07a64fbb9f22a599b774 (patch)
tree88d50c52464f322427b473bb6accec1a1b735dd2 /src/kerneldevice/mm-kernel-device-generic.c
parente5f08b776661eac1f3e151eb8fdf53edf190fca6 (diff)
kerneldevice,generic: move string match method to helpers
So that we can propertly unit-test it.
Diffstat (limited to 'src/kerneldevice/mm-kernel-device-generic.c')
-rw-r--r--src/kerneldevice/mm-kernel-device-generic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kerneldevice/mm-kernel-device-generic.c b/src/kerneldevice/mm-kernel-device-generic.c
index bfdd8c37..a8f34fed 100644
--- a/src/kerneldevice/mm-kernel-device-generic.c
+++ b/src/kerneldevice/mm-kernel-device-generic.c
@@ -796,7 +796,7 @@ check_condition (MMKernelDeviceGeneric *self,
/* Device name checks */
if (g_str_equal (match->parameter, "KERNEL"))
- return (string_match (self, mm_kernel_device_get_name (MM_KERNEL_DEVICE (self)), match->value) == condition_equal);
+ return (mm_kernel_device_generic_string_match (mm_kernel_device_get_name (MM_KERNEL_DEVICE (self)), match->value, self) == condition_equal);
/* Device sysfs path checks; we allow both a direct match and a prefix patch */
if (g_str_equal (match->parameter, "DEVPATH")) {
@@ -813,22 +813,22 @@ check_condition (MMKernelDeviceGeneric *self,
if (match->value[0] && match->value[strlen (match->value) - 1] != '*')
prefix_match = g_strdup_printf ("%s/*", match->value);
- if (string_match (self, self->priv->sysfs_path, match->value) == condition_equal) {
+ if (mm_kernel_device_generic_string_match (self->priv->sysfs_path, match->value, self) == condition_equal) {
result = TRUE;
goto out;
}
- if (prefix_match && string_match (self, self->priv->sysfs_path, prefix_match) == condition_equal) {
+ if (prefix_match && mm_kernel_device_generic_string_match (self->priv->sysfs_path, prefix_match, self) == condition_equal) {
result = TRUE;
goto out;
}
if (g_str_has_prefix (self->priv->sysfs_path, "/sys")) {
- if (string_match (self, &self->priv->sysfs_path[4], match->value) == condition_equal) {
+ if (mm_kernel_device_generic_string_match (&self->priv->sysfs_path[4], match->value, self) == condition_equal) {
result = TRUE;
goto out;
}
- if (prefix_match && string_match (self, &self->priv->sysfs_path[4], prefix_match) == condition_equal) {
+ if (prefix_match && mm_kernel_device_generic_string_match (&self->priv->sysfs_path[4], prefix_match, self) == condition_equal) {
result = TRUE;
goto out;
}