From 7c414b2d849fd16a0c987d4c9d33db9eee0a610d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 23 Mar 2026 08:44:01 +0000 Subject: mkhtemp: fix bad close the fd in fs_resolve_at is subsequently used note that in practise, this is not a real fix: the best fix is to cache all descriptors and free them at the end, once resolution is done. not a real fix, because now fd leaks, but it's dealt with on program close. not a util yet. just just stubbing this in main to test various features. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index cb08ec43..b4715e5b 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -35,6 +35,16 @@ main(int argc, char *argv[]) size_t c; + int rval; + char *test = NULL; + int fd = -1; + rval = new_tmpfile(&fd, &test); + if (rval < 0) + err_no_cleanup(errno, "TESTERR: "); + + printf("TEST: %s", test); + exit(1); + /* https://man.openbsd.org/pledge.2 https://man.openbsd.org/unveil.2 */ #if defined(__OpenBSD__) && defined(OpenBSD) -- cgit v1.2.1