termux-packages/root-packages/ettercap/ec_threads.c.patch

35 lines
1.1 KiB
Diff

--- ../ec_threads.c.orig 2019-08-27 20:09:25.304142288 +0200
+++ ./src/ec_threads.c 2019-08-27 20:14:11.753262944 +0200
@@ -233,13 +233,6 @@
DEBUG_MSG("ec_thread_init -- %lu", PTHREAD_ID(id));
INIT_LOCK;
-
- /*
- * allow a thread to be cancelled as soon as the
- * cancellation request is received
- */
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
/* sync with the creator */
if ((e = pthread_cond_signal(&init_cond)))
@@ -263,7 +256,7 @@
/* send the cancel signal to the thread */
- pthread_cancel((pthread_t)id);
+ pthread_kill((pthread_t)id, 0);
DEBUG_MSG("ec_thread_destroy -- [%s] terminated", ec_thread_getname(id));
@@ -319,7 +312,7 @@
DEBUG_MSG("ec_thread_kill_all -- terminating %lu [%s]", PTHREAD_ID(current->t.id), current->t.name);
/* send the cancel signal to the thread */
- pthread_cancel((pthread_t)current->t.id);
+ pthread_kill((pthread_t)current->t.id, 0);
#ifndef BROKEN_PTHREAD_JOIN
if (!current->t.detached) {