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-26 06:59:42 +0000
commit4260327edceebd4a4b6a57a1eb2ce2023c8ac333 (patch)
tree035631292ab68121f98302c1e473b782c20e9848
parent5a9e5017ea97935f979c62a6189e70afb73c9f50 (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