X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/blobdiff_plain/86c9bc4bc9e9b99482bcc5a2c6da8f5ec7516f69..aae68c41bca575de5d57e0b3b84e272a225520fd:/exec.c diff --git a/exec.c b/exec.c index 9b7e87b..afd7942 100644 --- a/exec.c +++ b/exec.c @@ -33,8 +33,9 @@ #ifdef HAVE_SETRLIMIT typedef struct xlimit { -#define R(r, n) struct rlimit n; -#include "rlimits.h" +#define XLIMIT_ENTRY(name, constant) struct rlimit name; + RLIMITS(XLIMIT_ENTRY) +#undef XLIMIT_ENTRY } xlimit; #endif @@ -138,8 +139,10 @@ typedef struct rlimit_ent { } rlimit_ent; static rlimit_ent rlimits[] = { -#define R(r, n) { #n, #r, r, offsetof(xlimit, n) }, -#include "rlimits.h" +#define TABLE_ENTRY(name, constant) \ + { #name, #constant, constant, offsetof(xlimit, name) }, + RLIMITS(TABLE_ENTRY) +#undef TABLE_ENTRY { 0, 0, 0, 0 } }; @@ -269,8 +272,9 @@ static int rlimit_option(xlimit *xl, scanner *sc) break; case w_soft: if (v > rl->rlim_max) - error(sc, "soft limit %l exceeds hard limit %l for %s", - v, rl->rlim_max, chosen->rname); + error(sc, "soft limit %lu exceeds hard limit %lu for %s", + (unsigned long)v, (unsigned long)rl->rlim_max, + chosen->rname); rl->rlim_cur = v; break; case w_hard: