From 6e08614e69757475a3b9f8417cc8c7124047d0b9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 4 Mar 2026 00:51:24 +0000 Subject: util/nvmutil: reset fd/rfd to negative one Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 4104cb53..46714a23 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -69,8 +69,8 @@ static uint16_t macbuf[3]; static off_t partsize; static int flags; -static int rfd; -static int fd; +static int rfd = -1; +static int fd = -1; static int part; static int invert; static int part_modified[2]; @@ -173,7 +173,8 @@ reset_global_state(void) part_modified[1] = 0; fname = ""; cmd = NULL; - fd = 0; + fd = -1; + rfd = -1; part = 0; memset(macbuf, 0, sizeof(macbuf)); -- cgit v1.2.1