Prefer getentropy() over arc4random() to seed the string hash (#3629)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
glibc's arc4random() aborts with "Fatal glibc error: cannot get entropy for arc4random" when the kernel lacks getrandom(2), so jq died on startup on older kernels once 0c7d133 began seeding the hash on every run. getentropy() merely returns -1/ENOSYS there, so prefer it, and route its failure through the existing `/dev/urandom` path - which works on precisely those kernels -- instead of a guessable `getpid() ^ time()`.
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+12 added−7 removed
- other:+12 added−7 removed