Skip to content

Commit

Permalink
atheme-compat.h: add MODFLAG_FAIL definition
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmdjones committed Jun 30, 2018
1 parent 2d00225 commit 74209ff
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
5 changes: 4 additions & 1 deletion atheme-compat.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2012 William Pitcock <nenolod@dereferenced.org>
* Copyright (C) 2018 Atheme Development Group <https://atheme.github.io/>
* Copyright (C) 2018 Atheme Development Group (https://atheme.github.io/)
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -84,6 +84,9 @@ typedef char *stringref;
# define ATHEME_VATTR_UNUSED /* No variable attribute support */
# endif

// This new name was introduced in the Atheme 7.3 development series.
#define MODFLAG_FAIL MODTYPE_FAIL

/* These 2 macros were introduced in the Atheme 7.3 development series and
* they're much nicer to use.
*/
Expand Down
14 changes: 7 additions & 7 deletions backtrace.c
Expand Up @@ -353,7 +353,7 @@ mod_init(module_t *const restrict m)
{
(void) slog(LG_ERROR, "%s: sigfillset(3) failed: %s", m->name, strerror(errno));

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand All @@ -367,7 +367,7 @@ mod_init(module_t *const restrict m)
{
(void) slog(LG_ERROR, "%s: sigaction(2) for SIGBUS failed: %s", m->name, strerror(errno));

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}
if (sigaction(SIGFPE, &newsigaction, &oldfpeaction) != 0)
Expand All @@ -376,7 +376,7 @@ mod_init(module_t *const restrict m)

(void) sigaction(SIGBUS, &oldbusaction, NULL);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}
if (sigaction(SIGILL, &newsigaction, &oldillaction) != 0)
Expand All @@ -386,7 +386,7 @@ mod_init(module_t *const restrict m)
(void) sigaction(SIGBUS, &oldbusaction, NULL);
(void) sigaction(SIGFPE, &oldfpeaction, NULL);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}
if (sigaction(SIGSEGV, &newsigaction, &oldsegvaction) != 0)
Expand All @@ -397,7 +397,7 @@ mod_init(module_t *const restrict m)
(void) sigaction(SIGFPE, &oldfpeaction, NULL);
(void) sigaction(SIGILL, &oldillaction, NULL);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand All @@ -411,7 +411,7 @@ mod_init(module_t *const restrict m)
(void) sigaction(SIGILL, &oldillaction, NULL);
(void) sigaction(SIGSEGV, &oldsegvaction, NULL);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down Expand Up @@ -442,7 +442,7 @@ mod_init(module_t *const restrict m)
(void) slog(LG_ERROR, "%s: this module only supports Linux systems with GNU libc >= 2.1", m->name);
(void) slog(LG_ERROR, "%s: please check your configuration and build environment", m->name);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion cs_badwords.c
Expand Up @@ -502,7 +502,7 @@ mod_init(module_t *const restrict m)
if (!module_find_published("backend/opensex"))
{
slog(LG_INFO, "Module %s requires use of the OpenSEX database backend, refusing to load.", m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions dnsbl.c
Expand Up @@ -601,14 +601,14 @@ mod_init(module_t *m)
if (!module_find_published("backend/opensex"))
{
(void) slog(LG_ERROR, "Module %s requires use of the OpenSEX database backend, refusing to load.", m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

if (! (dns_base = mowgli_dns_create(base_eventloop, MOWGLI_DNS_TYPE_ASYNC)))
{
(void) slog(LG_ERROR, "%s: failed to create Mowgli DNS resolver object", m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion ns_goodmail.c
Expand Up @@ -205,7 +205,7 @@ mod_init(module_t *const restrict m)
if (!module_find_published("backend/opensex"))
{
slog(LG_INFO, "Module %s requires use of the OpenSEX database backend, refusing to load.", m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion os_joinmon.c
Expand Up @@ -222,7 +222,7 @@ mod_init(module_t *const restrict m)
if (!module_find_published("backend/opensex"))
{
slog(LG_INFO, "Module %s requires use of the OpenSEX database backend, refusing to load.", m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion os_procwatch.c
Expand Up @@ -83,7 +83,7 @@ mod_init(module_t *const restrict m)

if (kq == -1)
{
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions os_resolve.c
Expand Up @@ -110,14 +110,14 @@ mod_init(module_t *const restrict m)
if (! (request_heap = mowgli_heap_create(sizeof(struct resolve_request), 32, BH_NOW)))
{
(void) slog(LG_ERROR, _("%s: failed to create Mowgli heap object"), m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

if (! (dns_base = mowgli_dns_create(base_eventloop, MOWGLI_DNS_TYPE_ASYNC)))
{
(void) slog(LG_ERROR, _("%s: failed to create Mowgli DNS resolver object"), m->name);
m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down
4 changes: 2 additions & 2 deletions os_trace.c
Expand Up @@ -989,7 +989,7 @@ mod_init(module_t *const restrict m)
{
(void) slog(LG_ERROR, "%s: mowgli_patricia_create() failed", m->name);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}
if (! (trace_acttree = mowgli_patricia_create(&strcasecanon)))
Expand All @@ -998,7 +998,7 @@ mod_init(module_t *const restrict m)

(void) mowgli_patricia_destroy(trace_cmdtree, NULL, NULL);

m->mflags |= MODTYPE_FAIL;
m->mflags |= MODFLAG_FAIL;
return;
}

Expand Down

0 comments on commit 74209ff

Please sign in to comment.