diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-11 09:43:08 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-09-11 09:55:05 +0200 |
commit | 9aa0c00323feac151540cd0bae62cdf8bb4e4164 (patch) | |
tree | 1cc78f7fdb54e17ac3cb541ff218306b70338105 | |
parent | 3aa75a8fdcc7f6f6273805da340c437a1446ef15 (diff) |
qmi-utils: 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.
https://bugs.freedesktop.org/show_bug.cgi?id=99944
(cherry picked from commit 6097ad583b89ad692e1d629088185a6728e34e5f)
-rw-r--r-- | src/libqmi-glib/qmi-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c index 29e5f22..810640c 100644 --- a/src/libqmi-glib/qmi-utils.c +++ b/src/libqmi-glib/qmi-utils.c @@ -740,7 +740,7 @@ __qmi_utils_get_driver (const gchar *cdc_wdm_path) * /sys/bus/usb/drivers/qmi_wwan */ tmp = g_strdup_printf ("/sys/class/%s/%s/device/driver", 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)) |