pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/comms/asterisk16/patches
Module Name: pkgsrc
Committed By: ryoon
Date: Thu Feb 11 11:54:13 UTC 2021
Added Files:
pkgsrc/comms/asterisk16/patches: patch-main_bridge__channel.c
patch-main_taskprocessor.c patch-res_res__xmpp.c
Log Message:
asterisk16: Add forgotten patches
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
pkgsrc/comms/asterisk16/patches/patch-main_bridge__channel.c \
pkgsrc/comms/asterisk16/patches/patch-main_taskprocessor.c \
pkgsrc/comms/asterisk16/patches/patch-res_res__xmpp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/comms/asterisk16/patches/patch-main_bridge__channel.c
diff -u /dev/null pkgsrc/comms/asterisk16/patches/patch-main_bridge__channel.c:1.1
--- /dev/null Thu Feb 11 11:54:13 2021
+++ pkgsrc/comms/asterisk16/patches/patch-main_bridge__channel.c Thu Feb 11 11:54:13 2021
@@ -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);
Index: pkgsrc/comms/asterisk16/patches/patch-main_taskprocessor.c
diff -u /dev/null pkgsrc/comms/asterisk16/patches/patch-main_taskprocessor.c:1.1
--- /dev/null Thu Feb 11 11:54:13 2021
+++ pkgsrc/comms/asterisk16/patches/patch-main_taskprocessor.c Thu Feb 11 11:54:13 2021
@@ -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;
+ }
Index: pkgsrc/comms/asterisk16/patches/patch-res_res__xmpp.c
diff -u /dev/null pkgsrc/comms/asterisk16/patches/patch-res_res__xmpp.c:1.1
--- /dev/null Thu Feb 11 11:54:13 2021
+++ pkgsrc/comms/asterisk16/patches/patch-res_res__xmpp.c Thu Feb 11 11:54:13 2021
@@ -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