diff options
author | Leah Rowe <leah@libreboot.org> | 2025-01-27 04:59:17 +0000 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-01-27 04:59:17 +0000 |
commit | c91cc329cf8bdb8df55207908eb47cdcae3d3498 (patch) | |
tree | e90a182dc1c6457524e86c1117782ede503cadc5 | |
parent | 906071083306722e43cd5d3c0bdf2fc2ad3b69c8 (diff) |
util/nvmutil: rename tbw/bw to tnw/nw
to match nr in the readGbe function
number of bytes written, and total number
of bytes written.
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r-- | util/nvmutil/nvmutil.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 13fce715..76ad14ce 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -427,27 +427,27 @@ writeGbe(void) if ((!gbeFileChanged) || (flags == O_RDONLY)) return; - ssize_t tbw = 0; /* total bytes written */ + ssize_t tnw = 0; /* total bytes written */ for (int p = 0; p < 2; p++) { if ((!nvmPartChanged[p])) continue; swap(p); /* swap bytes on big-endian host CPUs */ - ssize_t bw = pwrite(fd, (uint8_t *) gbe[p], nf, p * partsize); - err_if(bw == -1); - if (bw != nf) + ssize_t nw = pwrite(fd, (uint8_t *) gbe[p], nf, p * partsize); + err_if(nw == -1); + if (nw != nf) err(errno == ECANCELED, "%ld bytes written on '%s', expected %ld bytes\n", - bw, filename, nf); + nw, filename, nf); - tbw += nf; + tnw += nf; } - if ((!tbw) && (gbeFileChanged)) + if ((!tnw) && (gbeFileChanged)) fprintf(stderr, "No changes needed on file '%s'\n", filename); - else if (tbw) - printf("%ld bytes written to file '%s'\n", tbw, filename); + else if (tnw) + printf("%ld bytes written to file '%s'\n", tnw, filename); errno = 0; err_if(close(fd) == -1); |