retroshare: fix musl.

This commit is contained in:
Enno Boland 2017-05-21 00:16:35 +02:00
parent ebc1b90c88
commit 05dccbba25
1 changed files with 29 additions and 0 deletions

View File

@ -25,3 +25,32 @@
+#endif // defined(__linux__) && defined(__GLIBC__)
#endif // _STACKTRACE_H_
--- libretroshare/src/util/rsdir.cc.orig 2017-05-21 00:02:56.024215330 +0200
+++ libretroshare/src/util/rsdir.cc 2017-05-21 00:05:01.129867612 +0200
@@ -57,6 +57,25 @@
#include <errno.h>
#endif
+#ifndef __GLIBC__
+#include <limits.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.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
+
+
/****
* #define RSDIR_DEBUG 1
****/