diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-11-11 10:54:54 -0500 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-17 17:58:35 +0200 |
commit | e4dd0722cae89f144f3a4cf163e706e7dc071728 (patch) | |
tree | 4eaf310272c492a6f1e343f0c7f108dde7591912 /src | |
parent | b5f1976b7a6c8b3cb7c5befa72aee4b4688f9c81 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/virt.c b/src/basic/virt.c index 35beebe7f..c935c534b 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -498,7 +498,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); |