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.
This commit is contained in:
Lennart Poettering 2020-05-10 11:14:10 +02:00
parent 57ee010ff2
commit e2b5546452
1 changed files with 2 additions and 1 deletions

View File

@ -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;