summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/cgroup.c6
-rw-r--r--src/core/dbus-execute.c2
-rw-r--r--src/core/execute.c8
-rw-r--r--src/core/load-fragment.c2
-rw-r--r--src/core/main.c4
-rw-r--r--src/core/manager.c2
-rw-r--r--src/core/timer.c4
7 files changed, 14 insertions, 14 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index db8b4d7705..a52de2db69 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -41,7 +41,7 @@ void cgroup_context_init(CGroupContext *c) {
c->blockio_weight = (unsigned long) -1;
c->startup_blockio_weight = (unsigned long) -1;
- c->cpu_quota_per_sec_usec = (usec_t) -1;
+ c->cpu_quota_per_sec_usec = USEC_INFINITY;
}
void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a) {
@@ -311,7 +311,7 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
if (r < 0)
log_warning("Failed to set cpu.cfs_period_us on %s: %s", path, strerror(-r));
- if (c->cpu_quota_per_sec_usec != (usec_t) -1) {
+ if (c->cpu_quota_per_sec_usec != USEC_INFINITY) {
sprintf(buf, USEC_FMT "\n", c->cpu_quota_per_sec_usec * CGROUP_CPU_QUOTA_PERIOD_USEC / USEC_PER_SEC);
r = cg_set_attribute("cpu", path, "cpu.cfs_quota_us", buf);
} else
@@ -447,7 +447,7 @@ CGroupControllerMask cgroup_context_get_mask(CGroupContext *c) {
if (c->cpu_accounting ||
c->cpu_shares != (unsigned long) -1 ||
c->startup_cpu_shares != (unsigned long) -1 ||
- c->cpu_quota_per_sec_usec != (usec_t) -1)
+ c->cpu_quota_per_sec_usec != USEC_INFINITY)
mask |= CGROUP_CPUACCT | CGROUP_CPU;
if (c->blockio_accounting ||
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index ecbadd765b..9276da4cdc 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -300,7 +300,7 @@ static int property_get_timer_slack_nsec(
assert(reply);
assert(c);
- if (c->timer_slack_nsec != (nsec_t) -1)
+ if (c->timer_slack_nsec != NSEC_INFINITY)
u = (uint64_t) c->timer_slack_nsec;
else
u = (uint64_t) prctl(PR_GET_TIMERSLACK);
diff --git a/src/core/execute.c b/src/core/execute.c
index 6e76bd5b50..d8452a666c 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -333,7 +333,7 @@ static int setup_input(const ExecContext *context, int socket_fd, bool apply_tty
i == EXEC_INPUT_TTY_FAIL,
i == EXEC_INPUT_TTY_FORCE,
false,
- (usec_t) -1);
+ USEC_INFINITY);
if (fd < 0)
return fd;
@@ -1464,7 +1464,7 @@ int exec_spawn(ExecCommand *command,
goto fail_child;
}
- if (context->timer_slack_nsec != (nsec_t) -1)
+ if (context->timer_slack_nsec != NSEC_INFINITY)
if (prctl(PR_SET_TIMERSLACK, context->timer_slack_nsec) < 0) {
err = -errno;
r = EXIT_TIMERSLACK;
@@ -1833,7 +1833,7 @@ void exec_context_init(ExecContext *c) {
c->syslog_priority = LOG_DAEMON|LOG_INFO;
c->syslog_level_prefix = true;
c->ignore_sigpipe = true;
- c->timer_slack_nsec = (nsec_t) -1;
+ c->timer_slack_nsec = NSEC_INFINITY;
c->personality = 0xffffffffUL;
c->runtime_directory_mode = 0755;
}
@@ -2177,7 +2177,7 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
fputs("\n", f);
}
- if (c->timer_slack_nsec != (nsec_t) -1)
+ if (c->timer_slack_nsec != NSEC_INFINITY)
fprintf(f, "%sTimerSlackNSec: "NSEC_FMT "\n", prefix, c->timer_slack_nsec);
fprintf(f,
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 81f137946c..6d8431015d 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2510,7 +2510,7 @@ int config_parse_cpu_quota(
assert(rvalue);
if (isempty(rvalue)) {
- c->cpu_quota_per_sec_usec = (usec_t) -1;
+ c->cpu_quota_per_sec_usec = USEC_INFINITY;
return 0;
}
diff --git a/src/core/main.c b/src/core/main.c
index f67c003941..2741989c48 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -109,7 +109,7 @@ static usec_t arg_shutdown_watchdog = 10 * USEC_PER_MINUTE;
static char **arg_default_environment = NULL;
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 nsec_t arg_timer_slack_nsec = NSEC_INFINITY;
static usec_t arg_default_timer_accuracy_usec = 1 * USEC_PER_MINUTE;
static Set* arg_syscall_archs = NULL;
static FILE* arg_serialization = NULL;
@@ -1604,7 +1604,7 @@ int main(int argc, char *argv[]) {
if (arg_running_as == SYSTEMD_SYSTEM && arg_runtime_watchdog > 0)
watchdog_set_timeout(&arg_runtime_watchdog);
- if (arg_timer_slack_nsec != (nsec_t) -1)
+ if (arg_timer_slack_nsec != NSEC_INFINITY)
if (prctl(PR_SET_TIMERSLACK, arg_timer_slack_nsec) < 0)
log_error("Failed to adjust timer slack: %m");
diff --git a/src/core/manager.c b/src/core/manager.c
index 0653d7e59a..af508ef30c 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1875,7 +1875,7 @@ int manager_loop(Manager *m) {
if (wait_usec <= 0)
wait_usec = 1;
} else
- wait_usec = (usec_t) -1;
+ wait_usec = USEC_INFINITY;
r = sd_event_run(m->event, wait_usec);
if (r < 0) {
diff --git a/src/core/timer.c b/src/core/timer.c
index e69dfbd1e4..a5a33a6e6f 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -46,8 +46,8 @@ static void timer_init(Unit *u) {
assert(u);
assert(u->load_state == UNIT_STUB);
- t->next_elapse_monotonic_or_boottime = (usec_t) -1;
- t->next_elapse_realtime = (usec_t) -1;
+ t->next_elapse_monotonic_or_boottime = USEC_INFINITY;
+ t->next_elapse_realtime = USEC_INFINITY;
t->accuracy_usec = u->manager->default_timer_accuracy_usec;
}