Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
Add segfault handler for chat thread.
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Roff committed Mar 28, 2000
1 parent 095b642 commit 217cd14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions licq/src/daemon/icqd-chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "licq_constants.h"
#include "licq_icqd.h"
#include "licq_translate.h"
#include "licq_sighandler.h"
#include "support.h"

#define DEBUG_THREADS(x)
Expand Down Expand Up @@ -1153,6 +1154,8 @@ void *ChatManager_tep(void *arg)
{
CChatManager *chatman = (CChatManager *)arg;

licq_segv_handler(&signal_handler_chatThread);

fd_set f;
int l, nSocketsAvailable, nCurrentSocket;
char buf[2];
Expand Down
8 changes: 8 additions & 0 deletions licq/src/daemon/sighandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ void signal_handler_managerThread(int s /*, siginfo_t *si, void *context */)



void signal_handler_chatThread(int s /*, siginfo_t *si, void *context */)
{
if (s == SIGSEGV)
licq_handle_sigsegv("Chat Thread" /*, si, context */);
}



void signal_handler_eventThread(int s /*, siginfo_t *si, void *context */)
{
if (s == SIGSEGV)
Expand Down
1 change: 1 addition & 0 deletions licq/src/inc/licq_sighandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ extern "C" {
void licq_segv_handler(void (*f)(int /*, siginfo_t *, void **/));

void signal_handler_eventThread(int /*, siginfo_t *, void * */);
void signal_handler_chatThread(int /*, siginfo_t *, void * */);
void signal_handler_pingThread(int /*, siginfo_t *, void * */);
void signal_handler_managerThread(int /*, siginfo_t *, void * */);
void signal_handler_monitorThread(int /*, siginfo_t *, void * */);
Expand Down

0 comments on commit 217cd14

Please sign in to comment.