diff options
author | lbmkplaceholder <placeholder@lbmkplaceholder.com> | 2022-12-24 01:18:17 +0000 |
---|---|---|
committer | lbmkplaceholder <placeholder@lbmkplaceholder.com> | 2022-12-24 01:18:17 +0000 |
commit | d45b2e70dcba4a36f504ed6f168112236bf9d7bf (patch) | |
tree | 5358151363e997f2627a784202f20e3051489550 | |
parent | d726b16f5f223073e97856bac2c1e35d30f30e66 (diff) |
util/nvmutil: use err() more consistently
-rw-r--r-- | util/nvmutil/nvmutil.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 7614a030..33f23899 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -50,6 +50,7 @@ void setWord(int pos16, int partnum, uint16_t val); void byteswap(uint8_t *byte); void writeGbeFile(int *fd, const char *filename); +#define PROGNAME argv[0] #define FILENAME argv[1] #define COMMAND argv[2] #define MAC_ADDRESS argv[3] @@ -134,7 +135,7 @@ main(int argc, char *argv[]) nvmutil_exit: if (!((errno == ECANCELED) && (flags == O_RDONLY))) if (errno != 0) - fprintf(stderr, "%s\n", strerror(errno)); + err(errno, NULL); return errno; } @@ -445,7 +446,7 @@ writeGbeFile(int *fd, const char *filename) if (close((*fd))) err(errno, "%s", filename); if (errno != 0) - return; + err(errno, "%s", filename); for (partnum = 0; partnum < 2; partnum++) { if (nvmPartModified[partnum]) |