From a924d43bdd2ad836ce275cad87a27e8c22ce2fd8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 28 Jan 2023 14:11:17 +0000 Subject: util/nvmutil: fix clang build errors --- util/nvmutil/nvmutil.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'util') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index e7c9f152..890d2c3f 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -120,7 +120,6 @@ main(int argc, char *argv[]) if ((cmd == &cmd_copy) || (cmd == &cmd_swap)) nr = SIZE_4KB; - if ((cmd == &cmd_copy) || (cmd == &cmd_setchecksum) || (cmd == &cmd_brick)) skipread[part ^ 1] = 1; @@ -131,6 +130,7 @@ main(int argc, char *argv[]) cmd_setmac(strMac); else if (cmd != NULL) (*cmd)(); + if (gbeFileModified) writeGbeFile(&fd, FILENAME); @@ -148,12 +148,11 @@ readGbeFile(int *fd, const char *path, int flags, size_t nr) int p, r, tr = 0; if (opendir(path) != NULL) - err(errno = EISDIR, path); + err(errno = EISDIR, "%s", path); if (((*fd) = open(path, flags)) == -1) - err(errno, path); + err(errno, "%s", path); if (fstat((*fd), &st) == -1) - err(errno, path); - + err(errno, "%s", path); if ((st.st_size != SIZE_8KB)) { fprintf(stderr, "%s: Bad file size (must be 8KiB)\n", path); err(errno = ECANCELED, NULL); @@ -162,13 +161,13 @@ readGbeFile(int *fd, const char *path, int flags, size_t nr) if (errno == ENOTDIR) errno = 0; if (errno != 0) - err(errno, path); + err(errno, "%s", path); for (p = 0; p < 2; p++) { if (skipread[p]) continue; if ((r = pread((*fd), (uint8_t *) gbe[p], nr, p << 12)) == -1) - err(errno, path); + err(errno, "%s", path); tr += r; } printf("%d bytes read from file: `%s`\n", tr, path); -- cgit v1.2.1