1 From 6b043b9b676e88a80e3d4013863c5e970fdde1df Mon Sep 17 00:00:00 2001
2 From: Aleksander Morgado <aleksander@aleksander.es>
3 Date: Mon, 11 Sep 2017 09:31:03 +0200
4 Subject: [PATCH] mbim-device: prefer realpath() to canonicalize_file_name()
6 Usually the canonicalize_file_name() GNU extension is preferred to the
7 POSIX realpath(), as it covers some of the limitations the latter has.
8 But this extension isn't available in lots of platforms or in other
9 c library implementations (e.g. musl), so just default to the POSIX
10 method to improve portability.
12 Note that the check for canonicalize_file_name() availability during
13 configure isn't as trivial as adding a new AC_CHECK_FUNCS(), and
14 importing a gnulib module seems overkill just for this one liner.
16 (cherry picked from commit 417b0b80023dc30d61c111ec0a54da2884d3a541)
17 Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
19 src/libmbim-glib/mbim-device.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
22 diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c
23 index e1f32a6..20e64af 100644
24 --- a/src/libmbim-glib/mbim-device.c
25 +++ b/src/libmbim-glib/mbim-device.c
26 @@ -867,7 +867,7 @@ get_descriptors_filepath (MbimDevice *self)
27 * /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:2.0
29 tmp = g_strdup_printf ("/sys/class/%s/%s/device", subsystems[i], device_basename);
30 - path = canonicalize_file_name (tmp);
31 + path = realpath (tmp, NULL);
34 if (g_file_test (path, G_FILE_TEST_EXISTS)) {