aboutsummaryrefslogtreecommitdiffstats
path: root/community/bareos/pthread-double-detach.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/bareos/pthread-double-detach.patch')
-rw-r--r--community/bareos/pthread-double-detach.patch39
1 files changed, 0 insertions, 39 deletions
diff --git a/community/bareos/pthread-double-detach.patch b/community/bareos/pthread-double-detach.patch
deleted file mode 100644
index b0fca51e8d..0000000000
--- a/community/bareos/pthread-double-detach.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- old/core/src/dird/job.cc
-+++ new/core/src/dird/job.cc
-@@ -455,7 +455,16 @@
- {
- JobControlRecord *jcr = (JobControlRecord *)arg;
-
-- pthread_detach(pthread_self());
-+ /* only detach if not yet detached */
-+ int _detachstate;
-+ pthread_attr_t _gattr;
-+ pthread_getattr_np(pthread_self(), &_gattr);
-+ pthread_attr_getdetachstate(&_gattr, &_detachstate);
-+ pthread_attr_destroy(&_gattr);
-+ if(_detachstate != PTHREAD_CREATE_DETACHED) {
-+ pthread_detach(pthread_self());
-+ }
-+
- Dsm_check(100);
-
- Dmsg0(200, "=====Start Job=========\n");
---- old/core/src/dird/ua_server.cc
-+++ new/core/src/dird/ua_server.cc
-@@ -77,7 +77,15 @@
- */
- void *HandleUserAgentClientRequest(BareosSocket *user_agent_socket)
- {
-- pthread_detach(pthread_self());
-+ /* only detach if not yet detached */
-+ int _detachstate;
-+ pthread_attr_t _gattr;
-+ pthread_getattr_np(pthread_self(), &_gattr);
-+ pthread_attr_getdetachstate(&_gattr, &_detachstate);
-+ pthread_attr_destroy(&_gattr);
-+ if(_detachstate != PTHREAD_CREATE_DETACHED) {
-+ pthread_detach(pthread_self());
-+ }
-
- JobControlRecord *jcr = new_control_jcr("-Console-", JT_CONSOLE);
-