summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.h
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-06-01 14:04:44 +0100
committerLeah Rowe <leah@libreboot.org>2023-06-01 14:04:44 +0100
commit99258a38ae98ed9465fa1d149b1e5bdb18f8ca3c (patch)
tree53823d1c86a08143f4c1ac839d2a96d975083726 /util/nvmutil/nvmutil.h
parent69fa333e25c070689b707e261b31b08be82d9fc4 (diff)
util/nvmutil: code cleanup (pledge/unveil calls)
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.h')
-rw-r--r--util/nvmutil/nvmutil.h4
1 files changed, 2 insertions, 2 deletions
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)