summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-09-18 16:26:03 +0100
committerLeah Rowe <leah@libreboot.org>2023-09-18 16:26:03 +0100
commitac0e49996a53e9ca9f579ff11204bc648160a0e8 (patch)
tree9fb0896abc6bf84a24d31e9c6f97f6ba4629ddc3 /util/nvmutil
parent83e6cfb294fd84e83aedb45aed3220b29ff4fbf2 (diff)
util/nvmutil: remove unnecessary xclose macro
it is only used once. use err_if instead. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index de7379db..03fe2acf 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -70,7 +70,6 @@ void (*cmd)(void) = NULL;
#define xpread(f, b, n, o, l) if (pread(f, b, n, o) == -1) err(ERR(), "%s", l)
#define handle_endianness(r) if (((uint8_t *) &endian)[0] ^ 1) xorswap_buf(r)
#define xpwrite(f, b, n, o, l) if (pwrite(f, b, n, o) == -1) err(ERR(), "%s", l)
-#define xclose(f, l) if (close(f) == -1) err(ERR(), "%s", l)
#define xorswap(x, y) x ^= y, y ^= x, x ^= y
#define word(pos16, partnum) buf16[pos16 + (partnum << 11)]
@@ -297,5 +296,5 @@ writeGbeFile(const char *filename)
handle_endianness(x);
xpwrite(fd, (uint8_t *) gbe[x], nf, x << 12, filename);
}
- xclose(fd, filename);
+ err_if(close(fd) == -1);
}