diff options
author | Christine Lemmer-Webber <cwebber@dustycloud.org> | 2021-10-10 20:59:04 -0400 |
---|---|---|
committer | Christine Lemmer-Webber <cwebber@dustycloud.org> | 2021-10-10 20:59:04 -0400 |
commit | 204cb986469b2751a3c3347a34a8013c1a0b6954 (patch) | |
tree | e91534db67add400e5213ec3becb6ab48544b470 /lib/getrandom.c | |
parent | b03b359b5b16c040c485a565f3ce92481ea43f41 (diff) | |
parent | e60469c8b6936575c079faaffa40a340e1d49f3c (diff) | |
download | guile-204cb986469b2751a3c3347a34a8013c1a0b6954.tar.gz |
Merge branch 'main' into compile-to-js-merge
Diffstat (limited to 'lib/getrandom.c')
-rw-r--r-- | lib/getrandom.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/getrandom.c b/lib/getrandom.c index b467caa7a..a186c4d3b 100644 --- a/lib/getrandom.c +++ b/lib/getrandom.c @@ -2,12 +2,12 @@ Copyright 2020-2021 Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -178,7 +178,11 @@ getrandom (void *buffer, size_t length, unsigned int flags) + (flags & GRND_NONBLOCK ? O_NONBLOCK : 0)); fd = open (randdevice[devrandom], oflags); if (fd < 0) - return fd; + { + if (errno == ENOENT || errno == ENOTDIR) + errno = ENOSYS; + return -1; + } randfd[devrandom] = fd; } |