mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-07-25 09:13:26 +00:00
cov 10381: check result of open()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2824 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
3ebd6fab52
commit
b4f61842b6
@ -1258,9 +1258,10 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len,
|
||||
|
||||
fd = open ("/dev/urandom", O_RDONLY);
|
||||
|
||||
rb = (unsigned long)read (fd, buf, len);
|
||||
|
||||
close (fd);
|
||||
if (fd >= 0) {
|
||||
rb = (unsigned long)read (fd, buf, len);
|
||||
close (fd);
|
||||
}
|
||||
|
||||
return (rb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user