Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00025.html>.
* lib/getrandom.c (getrandom): When open() fails with an error that does
not indicate the absence of the file, fail with that error code, not
with ENOSYS.
+2021-05-13 Bruno Haible <bruno@clisp.org>
+
+ getrandom: Produce a better error code.
+ Reported by Paul Eggert in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00025.html>.
+ * lib/getrandom.c (getrandom): When open() fails with an error that does
+ not indicate the absence of the file, fail with that error code, not
+ with ENOSYS.
+
2021-05-13 Bruno Haible <bruno@clisp.org>
fstatat: Document a glibc 2.7 bug.
fd = open (randdevice[devrandom], oflags);
if (fd < 0)
{
- errno = ENOSYS;
+ if (errno == ENOENT || errno == ENOTDIR)
+ errno = ENOSYS;
return -1;
}
randfd[devrandom] = fd;