From cc9959eca545943d015000901f49f1d0191484d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 23 Jun 2022 19:55:07 +0200 Subject: [PATCH] Avoid segfault if opening file failed. --- 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 */