summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-04-12 16:13:28 +0200
committerLennart Poettering <lennart@poettering.net>2016-04-12 16:19:57 +0200
commit3c6d8e57e870ed56dbb53ce62f0a3d32de101cd8 (patch)
tree86c8f475ec89015bb4ace239cfaa9db3c24af769 /src/systemctl
parent0bed31c1038c439cc5956fb44017ba28e503095b (diff)
systemctl: when we want to know whether there's a native unit file, don't choke on ELOOP
ELOOP indicates that there's a symlink in /etc for a native unit file, and that's completely OK.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9efdc63dde..f0e788a508 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5272,9 +5272,9 @@ static int enable_sysv_units(const char *verb, char **args) {
continue;
j = unit_file_exists(arg_scope, &paths, name);
- if (j < 0)
+ if (j < 0 && !IN_SET(j, -ELOOP, -ESHUTDOWN, -EADDRNOTAVAIL))
return log_error_errno(j, "Failed to lookup unit file state: %m");
- found_native = j > 0;
+ found_native = j != 0;
/* If we have both a native unit and a SysV script, enable/disable them both (below); for is-enabled,
* prefer the native unit */