From 9d44421024fda7554d8c0ae8ec37085917416e18 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 28 Jun 2022 16:58:24 -0600 Subject: [PATCH] Work in a one-line change as originally suggested in https://github.com/Unidata/netcdf-c/pull/2426. --- libsrc/posixio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsrc/posixio.c b/libsrc/posixio.c index 0e1c185003..5e541faac4 100644 --- a/libsrc/posixio.c +++ b/libsrc/posixio.c @@ -1634,7 +1634,7 @@ posixio_create(const char *path, int ioflags, #endif if(fd < 0) { - status = errno; + status = errno ? errno : ENOENT; goto unwind_new; } *((int *)&nciop->fd) = fd; /* cast away const */