summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-11 10:54:54 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-12-17 00:24:43 -0500
commita839ee75d85c4f1d3183b8955c62d54f6a8dec88 (patch)
treee1bfcd8bdcfdad6a486ff59b34fa806c72ecfa2c /src
parentcd4a5eff38f32bea5f1815f203972a6f1199a25b (diff)
basic/virt: fix userns check on CONFIG_USER_NS=n kernel (#4651)
ENOENT should be treated as "false", but because of the broken errno check it was treated as an error. So ConditionVirtualization=user-namespaces probably returned the correct answer, but only by accident. Fixes #4608.
Diffstat (limited to 'src')
-rw-r--r--src/basic/virt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 69b0f96183..d8d57381ad 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -496,7 +496,7 @@ static int userns_has_mapping(const char *name) {
f = fopen(name, "re");
if (!f) {
log_debug_errno(errno, "Failed to open %s: %m", name);
- return errno == -ENOENT ? false : -errno;
+ return errno == ENOENT ? false : -errno;
}
n = getline(&buf, &n_allocated, f);