From 99258a38ae98ed9465fa1d149b1e5bdb18f8ca3c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 1 Jun 2023 14:04:44 +0100 Subject: util/nvmutil: code cleanup (pledge/unveil calls) Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/nvmutil/nvmutil.h') diff --git a/util/nvmutil/nvmutil.h b/util/nvmutil/nvmutil.h index 458b4338..18255c3e 100644 --- a/util/nvmutil/nvmutil.h +++ b/util/nvmutil/nvmutil.h @@ -43,7 +43,7 @@ uint8_t *buf = (uint8_t *) &buf16; size_t nf = 128, gbe[2]; uint8_t skipread[2] = {0, 0}; -int flags = O_RDWR, fd = -1, part, gbeFileModified = 0; +int flags = O_RDWR, rfd, fd, part, gbeFileModified = 0; uint8_t nvmPartModified[2] = {0, 0}; int test = 1; @@ -54,7 +54,7 @@ int big_endian; #define xopen(f,l,p) if (opendir(l) != NULL) err(errno = EISDIR, "%s", l); \ if ((f = open(l, p)) == -1) err(ERR(), "%s", l); \ - struct stat st; if (fstat(f, &st) == -1) err(ERR(), "%s", l) + if (fstat(f, &st) == -1) err(ERR(), "%s", l) #define xpread(f, b, n, o, l) if (pread(f, b, n, o) == -1) err(ERR(), "%s", l) #define handle_endianness() if (big_endian) xorswap_buf(p) #define xpwrite(f, b, n, o, l) if (pwrite(f, b, n, o) == -1) err(ERR(), "%s", l) -- cgit v1.2.1