From 04da953c718f84b19e0ba8bb9d238ad9fa4371f4 Mon Sep 17 00:00:00 2001 From: lbmkplaceholder Date: Wed, 21 Dec 2022 15:31:02 +0000 Subject: util/nvmutil: return errno when calling err() --- util/nvmutil/nvmutil.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'util') 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"); -- cgit v1.2.1