pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/asterisk16/patches asterisk16: Add forgotten pat...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c6a69fc3ee61
branches:  trunk
changeset: 446610:c6a69fc3ee61
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Thu Feb 11 11:54:13 2021 +0000

description:
asterisk16: Add forgotten patches

diffstat:

 comms/asterisk16/patches/patch-main_bridge__channel.c |  38 +++++++++++++++++++
 comms/asterisk16/patches/patch-main_taskprocessor.c   |  38 +++++++++++++++++++
 comms/asterisk16/patches/patch-res_res__xmpp.c        |  29 ++++++++++++++
 3 files changed, 105 insertions(+), 0 deletions(-)

diffs (117 lines):

diff -r 300094ccde1f -r c6a69fc3ee61 comms/asterisk16/patches/patch-main_bridge__channel.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/asterisk16/patches/patch-main_bridge__channel.c     Thu Feb 11 11:54:13 2021 +0000
@@ -0,0 +1,38 @@
+$NetBSD: patch-main_bridge__channel.c,v 1.1 2021/02/11 11:54:13 ryoon Exp $
+
+* Fix segfault under NetBSD/aarch64 9.99.80.
+
+--- main/bridge_channel.c.orig 2021-01-21 16:28:04.000000000 +0000
++++ main/bridge_channel.c
+@@ -58,6 +58,13 @@
+ #include "asterisk/stream.h"
+ #include "asterisk/message.h"
+ 
++/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++      return t1 == t2;
++}
++
+ /*!
+  * \brief Used to queue an action frame onto a bridge channel and write an action frame into a bridge.
+  * \since 12.0.0
+@@ -258,7 +265,7 @@ int ast_bridge_channel_notify_talking(st
+  */
+ static void bridge_channel_poke(struct ast_bridge_channel *bridge_channel)
+ {
+-      if (!pthread_equal(pthread_self(), bridge_channel->thread)) {
++      if (!pt_pthread_equal(pthread_self(), bridge_channel->thread)) {
+               /* Wake up the bridge channel thread. */
+               ast_queue_frame(bridge_channel->chan, &ast_null_frame);
+       }
+@@ -971,7 +978,7 @@ static int bridge_channel_queue_action_d
+       };
+ 
+       /* Make sure we don't end up trying to wait on ourself to deliver the frame */
+-      ast_assert(!pthread_equal(pthread_self(), bridge_channel->thread));
++      ast_assert(!pt_pthread_equal(pthread_self(), bridge_channel->thread));
+ 
+       sync_payload = ast_alloca(sync_payload_len);
+       sync_payload->id = ast_atomic_fetchadd_int(&sync_ids, +1);
diff -r 300094ccde1f -r c6a69fc3ee61 comms/asterisk16/patches/patch-main_taskprocessor.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/asterisk16/patches/patch-main_taskprocessor.c       Thu Feb 11 11:54:13 2021 +0000
@@ -0,0 +1,38 @@
+$NetBSD: patch-main_taskprocessor.c,v 1.1 2021/02/11 11:54:13 ryoon Exp $
+
+* Fix segfault under NetBSD/aarch64 9.99.80.
+
+--- main/taskprocessor.c.orig  2021-01-21 16:28:04.000000000 +0000
++++ main/taskprocessor.c
+@@ -37,6 +37,13 @@
+ #include "asterisk/taskprocessor.h"
+ #include "asterisk/sem.h"
+ 
++/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++      return t1 == t2;
++}
++
+ /*!
+  * \brief tps_task structure is queued to a taskprocessor
+  *
+@@ -263,7 +270,7 @@ static void default_listener_shutdown(st
+ 
+       ast_assert(pvt->poll_thread != AST_PTHREADT_NULL);
+ 
+-      if (pthread_equal(pthread_self(), pvt->poll_thread)) {
++      if (pt_pthread_equal(pthread_self(), pvt->poll_thread)) {
+               res = pthread_detach(pvt->poll_thread);
+               if (res != 0) {
+                       ast_log(LOG_ERROR, "pthread_detach(): %s\n", strerror(errno));
+@@ -1268,7 +1275,7 @@ int ast_taskprocessor_is_task(struct ast
+       int is_task;
+ 
+       ao2_lock(tps);
+-      is_task = pthread_equal(tps->thread, pthread_self());
++      is_task = pt_pthread_equal(tps->thread, pthread_self());
+       ao2_unlock(tps);
+       return is_task;
+ }
diff -r 300094ccde1f -r c6a69fc3ee61 comms/asterisk16/patches/patch-res_res__xmpp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/asterisk16/patches/patch-res_res__xmpp.c    Thu Feb 11 11:54:13 2021 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-res_res__xmpp.c,v 1.1 2021/02/11 11:54:13 ryoon Exp $
+
+* Fix segfault under NetBSD/aarch64 9.99.80.
+
+--- res/res_xmpp.c.orig        2021-01-21 16:28:04.000000000 +0000
++++ res/res_xmpp.c
+@@ -62,6 +62,13 @@
+ #include "asterisk/config_options.h"
+ #include "asterisk/json.h"
+ 
++/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
++static int
++pt_pthread_equal(pthread_t t1, pthread_t t2)
++{
++      return t1 == t2;
++}
++
+ /*** DOCUMENTATION
+       <application name="JabberSend" language="en_US" module="res_xmpp">
+               <synopsis>
+@@ -3609,7 +3616,7 @@ static int xmpp_action_hook(void *data, 
+ 
+ int ast_xmpp_client_disconnect(struct ast_xmpp_client *client)
+ {
+-      if ((client->thread != AST_PTHREADT_NULL) && !pthread_equal(pthread_self(), client->thread)) {
++      if ((client->thread != AST_PTHREADT_NULL) && !pt_pthread_equal(pthread_self(), client->thread)) {
+               xmpp_client_change_state(client, XMPP_STATE_DISCONNECTING);
+               pthread_cancel(client->thread);
+               pthread_join(client->thread, NULL);



Home | Main Index | Thread Index | Old Index