This helps to debug problems with the new device name translation
code. We can think about removing this later when the code is known
to work well.
---
daemon/device-name-translation.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/daemon/device-name-translation.c b/daemon/device-name-translation.c
index 30173f5c2..b17f3c683 100644
--- a/daemon/device-name-translation.c
+++ b/daemon/device-name-translation.c
@@ -195,6 +195,10 @@ device_name_translation (const char *device)
return NULL;
}
+ /* If the device name is different, print the translation. */
+ if (STRNEQ (device, ret))
+ fprintf (stderr, "device name translated: %s -> %s\n", device, ret);
+
/* Now check the device is openable. */
fd = open (ret, O_RDONLY|O_CLOEXEC);
if (fd >= 0) {
@@ -281,5 +285,9 @@ reverse_device_name_translation (const char *device)
}
}
+ /* If the device name is different, print the translation. */
+ if (STRNEQ (device, ret))
+ fprintf (stderr, "reverse device name translated: %s -> %s\n", device,
ret);
+
return ret;
}
--
2.25.0