summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-04 20:51:03 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-12-04 22:29:58 +0100
commit071066a5e509d0138fd2941f46eb60e0a07106bb (patch)
tree221dbc66ce2508557b2ed440813ad96522d43914 /src
parent4fd944ec822414b743bc39de37a4751c729463d3 (diff)
systemctl: make an always true assert static
Silences a warning i clang
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index d5d6b9f7d5..561572cb35 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -82,6 +82,7 @@ static enum dependency {
DEPENDENCY_REVERSE,
DEPENDENCY_AFTER,
DEPENDENCY_BEFORE,
+ _DEPENDENCY_MAX
} arg_dependency = DEPENDENCY_FORWARD;
static const char *arg_job_mode = "replace";
static UnitFileScope arg_scope = UNIT_FILE_SYSTEM;
@@ -1183,7 +1184,7 @@ static int list_dependencies_print(const char *name, int level, unsigned int bra
static int list_dependencies_get_dependencies(sd_bus *bus, const char *name, char ***deps) {
- static const char *dependencies[] = {
+ static const char *dependencies[_DEPENDENCY_MAX] = {
[DEPENDENCY_FORWARD] = "Requires\0"
"RequiresOverridable\0"
"Requisite\0"
@@ -1206,7 +1207,7 @@ static int list_dependencies_get_dependencies(sd_bus *bus, const char *name, cha
assert(bus);
assert(name);
assert(deps);
- assert(arg_dependency < ELEMENTSOF(dependencies));
+ assert_cc(ELEMENTSOF(dependencies) == _DEPENDENCY_MAX);
path = unit_dbus_path_from_name(name);
if (!path)