summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init.c7
-rw-r--r--src/main.c6
-rw-r--r--src/memory.c16
3 files changed, 4 insertions, 25 deletions
diff --git a/src/init.c b/src/init.c
index 8cc49749f..14f8db1a0 100644
--- a/src/init.c
+++ b/src/init.c
@@ -522,14 +522,11 @@ int init_secondary(int ac, char **av)
* panic as necessary, and ignore all others.
*/
-#if defined(NSIG) && !defined(LINUX20) && !defined(LINUX22)
+#if defined(NSIG)
for (i = 1; i <= NSIG - 1; i++) {
#else
for (i = 1; i <= 31; i++) {
#endif
-#if defined(USE_THREADS) && defined(LINUX20)
- if (i != SIGUSR1)
-#endif
signal(i, SIG_IGN);
}
@@ -570,11 +567,9 @@ int init_secondary(int ac, char **av)
#endif
signal(SIGFPE, sighandler);
-#if !defined(USE_THREADS) || !defined(LINUX20)
#ifndef _WIN32
signal(SIGUSR1, sighandler); /* This is our "out-of-memory" panic switch */
#endif
-#endif
/* Initialize multi-language support */
lang_init();
diff --git a/src/main.c b/src/main.c
index 06c4bb550..104702f7f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -220,7 +220,7 @@ static void services_restart(void)
anope_cmd_squit(ServerName, quitmsg);
disconn(servsock);
close_log();
-#if defined(LINUX20) || defined(LINUX22)
+#ifndef _WIN32
pthread_kill_other_threads_np();
#endif
modules_unload_all(true);
@@ -424,7 +424,7 @@ void sighandler(int signum)
}
if (
-#if (!defined(USE_THREADS) || !defined(LINUX20)) && !defined(_WIN32)
+#ifndef _WIN32
signum == SIGUSR1 ||
#endif
!(quitmsg = calloc(BUFSIZE, 1))) {
@@ -606,7 +606,7 @@ int main(int ac, char **av, char **envp)
anope_cmd_squit(ServerName, quitmsg);
disconn(servsock);
close_log();
-#if defined(LINUX20) || defined(LINUX22)
+#ifndef _WIN32
pthread_kill_other_threads_np();
#endif
execve(SERVICES_BIN, av, envp);
diff --git a/src/memory.c b/src/memory.c
index 6c1d8dda7..c602a1827 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -37,15 +37,11 @@ void *smalloc(long size)
}
buf = malloc(size);
if (!buf)
-#if !defined(USE_THREADS) || !defined(LINUX20)
#ifndef _WIN32
raise(SIGUSR1);
#else
abort();
#endif
-#else
- abort();
-#endif
return buf;
}
@@ -66,15 +62,11 @@ void *scalloc(long elsize, long els)
}
buf = calloc(elsize, els);
if (!buf)
-#if !defined(USE_THREADS) || !defined(LINUX20)
#ifndef _WIN32
raise(SIGUSR1);
#else
abort();
#endif
-#else
- abort();
-#endif
return buf;
}
@@ -95,15 +87,11 @@ void *srealloc(void *oldptr, long newsize)
}
buf = realloc(oldptr, newsize);
if (!buf)
-#if !defined(USE_THREADS) || !defined(LINUX20)
#ifndef _WIN32
raise(SIGUSR1);
#else
abort();
#endif
-#else
- abort();
-#endif
return buf;
}
@@ -127,15 +115,11 @@ char *sstrdup(const char *src)
ret = strdup(src);
#endif
if (!ret)
-#if !defined(USE_THREADS) || !defined(LINUX20)
#ifndef _WIN32
raise(SIGUSR1);
#else
abort();
#endif
-#else
- abort();
-#endif
} else {
alog("sstrdup() called with NULL-arg");
if (debug)