summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-18 04:13:50 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-18 04:13:50 +0000
commit410408cecea38efd3508fcd40b8199fc72839017 (patch)
treed30a877d916d19e3809f01f1926e9f79aa0cc35e
parent6b41b901ce61661abb736fb97349f38b1051a4f4 (diff)
util/nvmutil: fix rlong static variables
whoops Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 615002e2..969a4a2a 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -989,10 +989,10 @@ hextonum(char ch_s)
unsigned long
rlong(void)
{
- static unsigned long mix;
- static unsigned long counter;
+ static unsigned long mix = 0;
+ static unsigned long counter = 0;
- static int fd;
+ static int fd = -1;
struct x_st_timeval tv;
@@ -1001,12 +1001,8 @@ rlong(void)
rval = 0;
- fd = -1;
nr = -1;
- mix = 0;
- counter = 0;
-
x_i_gettimeofday(&tv, NULL);
mix ^= (unsigned long)tv.tv_sec