summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlbmkplaceholder <placeholder@lbmkplaceholder.com>2022-12-21 15:31:02 +0000
committerlbmkplaceholder <placeholder@lbmkplaceholder.com>2022-12-21 15:31:02 +0000
commit04da953c718f84b19e0ba8bb9d238ad9fa4371f4 (patch)
treeeba7ffecef103488f421a32c7ec619bb567335a6
parent001878112a27233b978ea230af75a7f45356d084 (diff)
util/nvmutil: return errno when calling err()
-rw-r--r--util/nvmutil/nvmutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index a4f5a822..bbfa7b3d 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -81,13 +81,13 @@ main(int argc, char *argv[])
#ifdef HAVE_PLEDGE
if (pledge("stdio wpath", NULL) == -1)
- err(1, "pledge");
+ err(errno, "pledge");
#endif
if (argc == 3) {
if (strcmp(COMMAND, "dump") == 0) {
#ifdef HAVE_PLEDGE
if (pledge("stdio rpath", NULL) == -1)
- err(1, "pledge");
+ err(errno, "pledge");
#endif
flags = O_RDONLY;
cmd = &cmd_dump;
@@ -251,7 +251,7 @@ rhex(void)
rindex = 0;
if (rbuf == NULL)
if ((rbuf = (uint8_t *) malloc(BUFSIZ)) == NULL)
- err(1, NULL);
+ err(errno, NULL);
if (rfd != -1) {
if (close(rfd))
err(errno, "/dev/urandom");