diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-02-03 22:18:58 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-02-03 22:18:58 +0000 |
| commit | 64d58d0c5a01551f8bfc52291986d1b8d681aca5 (patch) | |
| tree | 4f846e63762be51699156e460c79be53d8045521 /LinBPQ.c | |
| parent | a5c4d344ccf55a47fd6bc91a327073915b6c281e (diff) | |
New upstream version 6.0.24.59a+repackupstream/6.0.24.59a+repack
Diffstat (limited to 'LinBPQ.c')
| -rw-r--r-- | LinBPQ.c | 58 |
1 files changed, 43 insertions, 15 deletions
@@ -21,7 +21,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses #define _CRT_SECURE_NO_DEPRECATE
-#include "CHeaders.h"
+#include "cheaders.h"
#include "bpqmail.h"
#ifdef WIN32
#include <Iphlpapi.h>
@@ -45,7 +45,11 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses BOOL APIENTRY Rig_Init();
-void GetSemaphore(struct SEM * Semaphore, int ID);
+
+
+#define GetSemaphore(Semaphore,ID) _GetSemaphore(Semaphore, ID, __FILE__, __LINE__)
+
+void _GetSemaphore(struct SEM * Semaphore, int ID, char * File, int Line);
void FreeSemaphore(struct SEM * Semaphore);
VOID CopyConfigFile(char * ConfigName);
VOID SendMailForThread(VOID * Param);
@@ -75,6 +79,8 @@ int upnpClose(); void SaveAIS();
void initAIS();
void DRATSPoll();
+void RHPPoll();
+
VOID GetPGConfig();
void SendBBSDataToPktMap();
@@ -374,24 +380,41 @@ BOOL CtrlHandler(DWORD fdwCtrlType) #include <execinfo.h>
#include <signal.h>
-
// Linux Signal Handlers
-
static void segvhandler(int sig)
{
- void *array[10];
- size_t size;
+ void *array[10];
+ size_t size;
+ char msg[] = "SIGSEGV Received\n";
+
+ write(STDERR_FILENO, msg, strlen(msg));
+
+ // get void*'s for all entries on the stack
+ size = backtrace(array, 10);
+
+ // print out all the frames to stderr
- // get void*'s for all entries on the stack
- size = backtrace(array, 10);
+ backtrace_symbols_fd(array, size, STDERR_FILENO);
- // print out all the frames to stderr
- fprintf(stderr, "Error: signal %d:\n", sig);
- backtrace_symbols_fd(array, size, STDERR_FILENO);
exit(1);
}
+static void abrthandler(int sig)
+{
+ void *array[10];
+ size_t size;
+ char msg[] = "SIGABRT Received\n";
+
+ write(STDERR_FILENO, msg, strlen(msg));
+
+ // get void*'s for all entries on the stack
+
+ size = backtrace(array, 10);
+ backtrace_symbols_fd(array, size, STDERR_FILENO);
+
+ exit(1);
+}
static void sigterm_handler(int sig)
{
@@ -481,9 +504,10 @@ VOID MonitorThread(void * x) {
// It is stuck - try to release
- Debugprintf ("Semaphore locked - Process ID = %d, Held By %d",
- Semaphore.SemProcessID, SemHeldByAPI);
-
+ Debugprintf ("Semaphore locked - Process ID = %d, Held By %d from %s Line %d",
+ Semaphore.SemProcessID, SemHeldByAPI, Semaphore.File, Semaphore.Line);
+
+
Semaphore.Flag = 0;
}
@@ -761,6 +785,8 @@ char HelpScreen[] = int Redirected = 0;
static void segvhandler(int sig);
+static void abrthandler(int sig);
+
int main(int argc, char * argv[])
{
@@ -792,7 +818,8 @@ int main(int argc, char * argv[]) #else
-// signal(SIGSEGV, segvhandler);
+ signal(SIGSEGV, segvhandler);
+ signal(SIGABRT, abrthandler);
setlinebuf(stdout);
struct sigaction act;
@@ -1560,6 +1587,7 @@ int main(int argc, char * argv[]) Poll_AGW();
DRATSPoll();
+ RHPPoll();
HTTPTimer();
|
