summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-05 02:29:58 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-05 02:31:09 +0100
commit517d56b1d0f67dcf76710bc1e17b05518b8cabe6 (patch)
tree1d1baa6af8fb323fc0c2eb02a1ae59dbeba2d049 /src/core
parenta049d1a9723b6608e45bf8f1a64dab5761dee555 (diff)
missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new define for the max number of rlimits, too
Diffstat (limited to 'src/core')
-rw-r--r--src/core/execute.c2
-rw-r--r--src/core/execute.h3
-rw-r--r--src/core/main.c2
-rw-r--r--src/core/manager.c4
-rw-r--r--src/core/manager.h2
-rw-r--r--src/core/unit.c2
6 files changed, 8 insertions, 7 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index fec4b3b13a..ca807dc8cb 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1676,7 +1676,7 @@ int exec_spawn(ExecCommand *command,
if (apply_permissions) {
- for (i = 0; i < RLIMIT_NLIMITS; i++) {
+ for (i = 0; i < _RLIMIT_MAX; i++) {
if (!context->rlimit[i])
continue;
diff --git a/src/core/execute.h b/src/core/execute.h
index 2c5d8bbf76..a333657328 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -38,6 +38,7 @@ typedef struct ExecRuntime ExecRuntime;
#include "util.h"
#include "set.h"
#include "fdset.h"
+#include "missing.h"
typedef enum ExecInput {
EXEC_INPUT_NULL,
@@ -93,7 +94,7 @@ struct ExecContext {
char **environment;
char **environment_files;
- struct rlimit *rlimit[RLIMIT_NLIMITS];
+ struct rlimit *rlimit[_RLIMIT_MAX];
char *working_directory, *root_directory;
mode_t umask;
diff --git a/src/core/main.c b/src/core/main.c
index 4ca847c781..25ddafee47 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -105,7 +105,7 @@ static unsigned arg_default_start_limit_burst = DEFAULT_START_LIMIT_BURST;
static usec_t arg_runtime_watchdog = 0;
static usec_t arg_shutdown_watchdog = 10 * USEC_PER_MINUTE;
static char **arg_default_environment = NULL;
-static struct rlimit *arg_default_rlimit[RLIMIT_NLIMITS] = {};
+static struct rlimit *arg_default_rlimit[_RLIMIT_MAX] = {};
static uint64_t arg_capability_bounding_set_drop = 0;
static nsec_t arg_timer_slack_nsec = (nsec_t) -1;
static Set* arg_syscall_archs = NULL;
diff --git a/src/core/manager.c b/src/core/manager.c
index 822c7ccfee..e4d03681ab 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -810,7 +810,7 @@ void manager_free(Manager *m) {
free(m->switch_root);
free(m->switch_root_init);
- for (i = 0; i < RLIMIT_NLIMITS; i++)
+ for (i = 0; i < _RLIMIT_MAX; i++)
free(m->rlimit[i]);
assert(hashmap_isempty(m->units_requiring_mounts_for));
@@ -2728,7 +2728,7 @@ int manager_set_default_rlimits(Manager *m, struct rlimit **default_rlimit) {
assert(m);
- for (i = 0; i < RLIMIT_NLIMITS; i++) {
+ for (i = 0; i < _RLIMIT_MAX; i++) {
if (!default_rlimit[i])
continue;
diff --git a/src/core/manager.h b/src/core/manager.h
index 92985caefb..e014abd04f 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -228,7 +228,7 @@ struct Manager {
bool default_memory_accounting;
bool default_blockio_accounting;
- struct rlimit *rlimit[RLIMIT_NLIMITS];
+ struct rlimit *rlimit[_RLIMIT_MAX];
/* non-zero if we are reloading or reexecuting, */
int n_reloading;
diff --git a/src/core/unit.c b/src/core/unit.c
index d0e915909a..2437ee3f66 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2803,7 +2803,7 @@ int unit_exec_context_patch_defaults(Unit *u, ExecContext *c) {
* _after_ the rest of the settings have been initialized */
/* This only copies in the ones that need memory */
- for (i = 0; i < RLIMIT_NLIMITS; i++)
+ for (i = 0; i < _RLIMIT_MAX; i++)
if (u->manager->rlimit[i] && !c->rlimit[i]) {
c->rlimit[i] = newdup(struct rlimit, u->manager->rlimit[i], 1);
if (!c->rlimit[i])