aboutsummaryrefslogtreecommitdiffstats
path: root/community/libqmi/musl-compat-canonicalize_file_name.patch
blob: 3ed1baf57e1609d02ce50c85120666611101abcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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