Message ID | 20230701122504.2890299-1-samuel.thibault@ens-lyon.org |
---|---|
State | New |
Headers | show |
Series | [hurd,commited] hurd: Make getrandom return ENOSYS when /dev/random is not set up | expand |
diff --git a/sysdeps/mach/hurd/getrandom.c b/sysdeps/mach/hurd/getrandom.c index 0d28f5c260..a7706afe82 100644 --- a/sysdeps/mach/hurd/getrandom.c +++ b/sysdeps/mach/hurd/getrandom.c @@ -123,8 +123,13 @@ again: open_flags, 0); __libc_rwlock_unlock (lock); if (!MACH_PORT_VALID (server)) - /* No luck. */ - return -1; + { + if (errno == ENOENT) + /* No translator set up, we won't have support for it. */ + errno = ENOSYS; + /* No luck. */ + return -1; + } goto again; }