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:
Clemens Fruhwirth
2008-08-20 10:40:45 +00:00
parent 643aed1891
commit 4884064723
5 changed files with 12 additions and 171 deletions

View File

@@ -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() {