aboutsummaryrefslogtreecommitdiffstats
path: root/main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch')
-rw-r--r--main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch b/main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch
new file mode 100644
index 00000000000..a8bcffefd09
--- /dev/null
+++ b/main/bacula/bacula-11.0.6-pthread-double-detach-fix.patch
@@ -0,0 +1,30 @@
+diff --git a/src/dird/ua_server.c b/src/dird/ua_server.c
+index 75342a3bfa..d8d767e81f 100644
+--- a/src/dird/ua_server.c
++++ b/src/dird/ua_server.c
+@@ -126,7 +126,9 @@ static void *handle_UA_client_request(void *arg)
+ JCR *jcr;
+ BSOCK *user = (BSOCK *)arg;
+
+- pthread_detach(pthread_self());
++ // Alpine: We know the thread is already detached (src/lib/workq.c:74).
++ // Detaching it again would crash on musl, so we disable this call
++ // pthread_detach(pthread_self());
+
+ jcr = new_control_jcr("-Console-", JT_CONSOLE);
+
+diff --git a/src/dird/job.c b/src/dird/job.c
+index 7df6351..62452bd 100644
+--- a/src/dird/job.c
++++ b/src/dird/job.c
+@@ -408,7 +408,9 @@ static void *job_thread(void *arg)
+ {
+ JCR *jcr = (JCR *)arg;
+
+- pthread_detach(pthread_self());
++ // Alpine: We know the thread is already detatched (src/lib/workq.c:74).
++ // Detatching it again would crash on musl, so we disable this call
++ // pthread_detach(pthread_self());
+ Dsm_check(100);
+
+ Dmsg0(200, "=====Start Job=========\n");