Refactor entropy.c
This commit is contained in:
parent
3f45a5f7ca
commit
951ea4e304
1 changed files with 6 additions and 3 deletions
|
@ -9,9 +9,12 @@
|
|||
{
|
||||
int num;
|
||||
|
||||
return (pscanf("/proc/sys/kernel/random/entropy_avail",
|
||||
"%d", &num) == 1) ?
|
||||
bprintf("%d", num) : NULL;
|
||||
if (pscanf("/proc/sys/kernel/random/entropy_avail",
|
||||
"%d", &num) != 1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bprintf("%d", num);
|
||||
}
|
||||
#elif defined(__OpenBSD__)
|
||||
const char *
|
||||
|
|
Loading…
Reference in a new issue