From ac0e49996a53e9ca9f579ff11204bc648160a0e8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 18 Sep 2023 16:26:03 +0100 Subject: util/nvmutil: remove unnecessary xclose macro it is only used once. use err_if instead. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'util') 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); } -- cgit v1.2.1