summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-06-01 11:14:49 +0100
committerLeah Rowe <leah@libreboot.org>2023-06-01 11:14:49 +0100
commit4d91bcc2d75ba9874ed352ef0fde5cfa128c4ebd (patch)
treee57e1570c54beb4ddfca817f5a261a18b584d491
parentc2c31677a317f4a3a20f4a88729c14519c001d92 (diff)
util/nvmutil: check correct return value on close()
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.h b/util/nvmutil/nvmutil.h
index 595ad3b0..c951148f 100644
--- a/util/nvmutil/nvmutil.h
+++ b/util/nvmutil/nvmutil.h
@@ -57,7 +57,7 @@ int big_endian;
#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)
-#define xclose(f, l) if (close(f)) 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)]