aboutsummaryrefslogtreecommitdiffstats
path: root/community/libqmi/musl-compat-canonicalize_file_name.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/libqmi/musl-compat-canonicalize_file_name.patch')
-rw-r--r--community/libqmi/musl-compat-canonicalize_file_name.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/community/libqmi/musl-compat-canonicalize_file_name.patch b/community/libqmi/musl-compat-canonicalize_file_name.patch
new file mode 100644
index 0000000000..3ed1baf57e
--- /dev/null
+++ b/community/libqmi/musl-compat-canonicalize_file_name.patch
@@ -0,0 +1,26 @@
+--- libqmi-1.17.901/src/libqmi-glib/qmi-utils.h
++++ libqmi-1.17.901/src/libqmi-glib/qmi-utils.h.new
+@@ -29,6 +29,23 @@
+ #error "Only <libqmi-glib.h> can be included directly."
+ #endif
+
++#ifndef HAVE_CANONICALIZE_FILE_NAME
++#include <limits.h>
++#include <string.h>
++#include <stdlib.h>
++static char * canonicalize_file_name(const char *path)
++{
++ char buf[PATH_MAX] = { };
++
++ snprintf(buf, sizeof(buf) - 1, "%s", path);
++
++ if (!realpath(path, buf))
++ return NULL;
++
++ return strdup(buf);
++}
++#endif
++
+ #include <glib.h>
+
+ G_BEGIN_DECLS