random-util: rename "err" to "success"

After all rdrand returns 1 on success, and 0 on failure, hence let's
name this accordingly.
This commit is contained in:
Lennart Poettering 2019-05-07 18:51:26 -04:00
parent 80eb560a5b
commit 328f850e36
1 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ int rdrand(unsigned long *ret) {
#if defined(__i386__) || defined(__x86_64__)
static int have_rdrand = -1;
unsigned char err;
uint8_t success;
if (have_rdrand < 0) {
uint32_t eax, ebx, ecx, edx;
@ -60,9 +60,9 @@ int rdrand(unsigned long *ret) {
asm volatile("rdrand %0;"
"setc %1"
: "=r" (*ret),
"=qm" (err));
msan_unpoison(&err, sizeof(err));
if (!err)
"=qm" (success));
msan_unpoison(&success, sizeof(sucess));
if (!success)
return -EAGAIN;
return 0;