diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-05-10 11:14:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-05-10 11:14:17 +0200 |
commit | e2b55464523adbb3732eb632ac2a21b685935642 (patch) | |
tree | 8f3c01c4687518178ae69250cf52723a9d927cbe /src/basic/random-util.c | |
parent | 57ee010ff2beb93f2353668a8e347981a8d46ff2 (diff) | |
download | systemd-e2b55464523adbb3732eb632ac2a21b685935642.tar.gz |
random-util: use ERRNO_IS_NOT_SUPPORTED() macro
Some container mgr or sandbox solution might block it with an unexpected
error code, hence let's be tolerant here.
Diffstat (limited to 'src/basic/random-util.c')
-rw-r--r-- | src/basic/random-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 363a1f7151..c32e6e2aac 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -19,6 +19,7 @@ #endif #include "alloc-util.h" +#include "errno-util.h" #include "fd-util.h" #include "fileio.h" #include "io-util.h" @@ -237,7 +238,7 @@ int genuine_random_bytes(void *p, size_t n, RandomFlags flags) { have_syscall = true; return -EIO; - } else if (errno == ENOSYS) { + } else if (ERRNO_IS_NOT_SUPPORTED(errno)) { /* We lack the syscall, continue with reading from /dev/urandom. */ have_syscall = false; break; |