Annotation of pkgsrc/comms/asterisk16/patches/patch-res_res__xmpp.c, Revision 1.1
1.1 ! ryoon 1: $NetBSD$
! 2:
! 3: * Fix segfault under NetBSD/aarch64 9.99.80.
! 4:
! 5: --- res/res_xmpp.c.orig 2021-01-21 16:28:04.000000000 +0000
! 6: +++ res/res_xmpp.c
! 7: @@ -62,6 +62,13 @@
! 8: #include "asterisk/config_options.h"
! 9: #include "asterisk/json.h"
! 10:
! 11: +/* XXX, pthread_equal() is misused to compare non-valid thread pointers */
! 12: +static int
! 13: +pt_pthread_equal(pthread_t t1, pthread_t t2)
! 14: +{
! 15: + return t1 == t2;
! 16: +}
! 17: +
! 18: /*** DOCUMENTATION
! 19: <application name="JabberSend" language="en_US" module="res_xmpp">
! 20: <synopsis>
! 21: @@ -3609,7 +3616,7 @@ static int xmpp_action_hook(void *data,
! 22:
! 23: int ast_xmpp_client_disconnect(struct ast_xmpp_client *client)
! 24: {
! 25: - if ((client->thread != AST_PTHREADT_NULL) && !pthread_equal(pthread_self(), client->thread)) {
! 26: + if ((client->thread != AST_PTHREADT_NULL) && !pt_pthread_equal(pthread_self(), client->thread)) {
! 27: xmpp_client_change_state(client, XMPP_STATE_DISCONNECTING);
! 28: pthread_cancel(client->thread);
! 29: pthread_join(client->thread, NULL);
CVSweb <webmaster@jp.NetBSD.org>