mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 03:40:05 +01:00
Error handling improvement thanks to Erik Edin.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@28 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -23,8 +23,6 @@ int openRandom() {
|
||||
closeRandom */
|
||||
int getRandom(char *buf, size_t len)
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
if(openRandom() == -1) {
|
||||
perror("getRandom:");
|
||||
return -EINVAL;
|
||||
@@ -37,7 +35,7 @@ int getRandom(char *buf, size_t len)
|
||||
}
|
||||
len-= r; buf += r;
|
||||
}
|
||||
return r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void closeRandom() {
|
||||
|
||||
Reference in New Issue
Block a user