diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-05 16:36:45 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-05 16:38:17 +0200 |
commit | 00d27e5dd74a6c67759def1e958a71aae0650976 (patch) | |
tree | 4f070dd604614dd4f80593d66afda353d9815de1 /src/shared/exit-status.c | |
parent | test: add a simple sanity check for systems without NUMA support (diff) | |
download | systemd-00d27e5dd74a6c67759def1e958a71aae0650976.tar.xz systemd-00d27e5dd74a6c67759def1e958a71aae0650976.zip |
shared/exit-status: fix lookup
FLAGS_SET() is the wrong operator here, because we want to see if
*any* bits are set. Add test.
https://github.com/systemd/systemd/pull/12884#issuecomment-518238410
Diffstat (limited to 'src/shared/exit-status.c')
-rw-r--r-- | src/shared/exit-status.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c index 44b1c9b749..3704f5d481 100644 --- a/src/shared/exit-status.c +++ b/src/shared/exit-status.c @@ -99,7 +99,7 @@ const ExitStatusMapping exit_status_mappings[256] = { const char* exit_status_to_string(int code, ExitStatusClass class) { if (code < 0 || (size_t) code >= ELEMENTSOF(exit_status_mappings)) return NULL; - return FLAGS_SET(exit_status_mappings[code].class, class) ? exit_status_mappings[code].name : NULL; + return class & exit_status_mappings[code].class ? exit_status_mappings[code].name : NULL; } const char* exit_status_class(int code) { |