diff options
authorAleksander Morgado <>2017-09-11 09:31:03 +0200
committerAleksander Morgado <>2017-09-11 09:36:08 +0200
commit417b0b80023dc30d61c111ec0a54da2884d3a541 (patch)
parent5bb673fe87ff9462bdec6435487d57982f886968 (diff)
mbim-device: prefer realpath() to canonicalize_file_name()
Usually the canonicalize_file_name() GNU extension is preferred to the POSIX realpath(), as it covers some of the limitations the latter has. But this extension isn't available in lots of platforms or in other c library implementations (e.g. musl), so just default to the POSIX method to improve portability. Note that the check for canonicalize_file_name() availability during configure isn't as trivial as adding a new AC_CHECK_FUNCS(), and importing a gnulib module seems overkill just for this one liner.
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c
index 4b7d431..824f387 100644
--- a/src/libmbim-glib/mbim-device.c
+++ b/src/libmbim-glib/mbim-device.c
@@ -876,7 +876,7 @@ get_descriptors_filepath (MbimDevice *self)
* /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:2.0
tmp = g_strdup_printf ("/sys/class/%s/%s/device", subsystems[i], device_basename);
- path = canonicalize_file_name (tmp);
+ path = realpath (tmp, NULL);
g_free (tmp);
if (g_file_test (path, G_FILE_TEST_EXISTS)) {