-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
zerotier/patches/0001-Fix-for-running-under-MUSL-libc-e.g.-Alpine-Linux.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From 830250759cd4c14ca2ae5ddf24f0a0427f258622 Mon Sep 17 00:00:00 2001 | ||
From: Adam Ierymenko <[email protected]> | ||
Date: Tue, 26 Jul 2016 16:36:20 -0700 | ||
Subject: [PATCH 1/2] Fix for running under MUSL libc (e.g. Alpine Linux) | ||
|
||
--- | ||
osdep/Thread.hpp | 7 ++++++- | ||
1 file changed, 6 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/osdep/Thread.hpp b/osdep/Thread.hpp | ||
index 7fb38d8..4f90dc0 100644 | ||
--- a/osdep/Thread.hpp | ||
+++ b/osdep/Thread.hpp | ||
@@ -125,6 +125,10 @@ public: | ||
throw() | ||
{ | ||
memset(&_tid,0,sizeof(_tid)); | ||
+ pthread_attr_init(&_tattr); | ||
+#ifdef __LINUX__ | ||
+ pthread_attr_setstacksize(&_tattr,8388608); // for MUSL libc and others, has no effect in normal glibc environments | ||
+#endif | ||
_started = false; | ||
} | ||
|
||
@@ -157,7 +161,7 @@ public: | ||
{ | ||
Thread t; | ||
t._started = true; | ||
- if (pthread_create(&t._tid,(const pthread_attr_t *)0,&___zt_threadMain<C>,instance)) | ||
+ if (pthread_create(&t._tid,&t._tattr,&___zt_threadMain<C>,instance)) | ||
throw std::runtime_error("pthread_create() failed, unable to create thread"); | ||
return t; | ||
} | ||
@@ -184,6 +188,7 @@ public: | ||
|
||
private: | ||
pthread_t _tid; | ||
+ pthread_attr_t _tattr; | ||
volatile bool _started; | ||
}; | ||
|
||
-- | ||
2.9.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
From f05a574e36c110ddab5912ea7f06f7c41a1c18dd Mon Sep 17 00:00:00 2001 | ||
From 333bbabc6dfad0553fb63d560ab6442a50cc9e52 Mon Sep 17 00:00:00 2001 | ||
From: Moritz Warning <[email protected]> | ||
Date: Sat, 9 Jul 2016 17:45:14 +0200 | ||
Subject: [PATCH 1/1] zerotier: fix build | ||
Date: Fri, 22 Jul 2016 23:27:31 +0200 | ||
Subject: [PATCH 2/2] fix build | ||
|
||
--- | ||
make-linux.mk | 30 +++++++++++++++--------------- | ||
osdep/ManagedRoute.cpp | 2 +- | ||
2 files changed, 16 insertions(+), 16 deletions(-) | ||
make-linux.mk | 30 +++++++++++++++--------------- | ||
1 file changed, 15 insertions(+), 15 deletions(-) | ||
|
||
diff --git a/make-linux.mk b/make-linux.mk | ||
index 13b1547..ed944ff 100644 | ||
index acc22a6..819e95f 100644 | ||
--- a/make-linux.mk | ||
+++ b/make-linux.mk | ||
@@ -39,24 +39,24 @@ include objects.mk | ||
|
@@ -52,19 +51,6 @@ index 13b1547..ed944ff 100644 | |
|
||
ifeq ($(ZT_USE_MINIUPNPC),1) | ||
OBJS+=osdep/PortMapper.o | ||
diff --git a/osdep/ManagedRoute.cpp b/osdep/ManagedRoute.cpp | ||
index 5499012..0fdc846 100644 | ||
--- a/osdep/ManagedRoute.cpp | ||
+++ b/osdep/ManagedRoute.cpp | ||
@@ -33,7 +33,7 @@ | ||
#ifdef __UNIX_LIKE__ | ||
#include <unistd.h> | ||
#include <sys/param.h> | ||
-#include <sys/sysctl.h> | ||
+//#include <sys/sysctl.h> | ||
#include <sys/socket.h> | ||
#include <sys/types.h> | ||
#include <sys/wait.h> | ||
-- | ||
2.9.0 | ||
|