From 92a49c7c8c30d9ae6a903c734091a2e9632423e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sun, 12 Jan 2025 02:16:44 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D1=83=D1=81=D1=82=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B8=D1=81=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=82=D0=B5=D1=80=D0=B8/=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20`errno`=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BD=D0=B5=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD=D0=BD?= =?UTF-8?q?=D1=8B=D1=85=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=D1=85=20?= =?UTF-8?q?=D0=B2=20`close()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/osal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osal.c b/src/osal.c index 01f0b11d..dd1c7b4b 100644 --- a/src/osal.c +++ b/src/osal.c @@ -1343,6 +1343,7 @@ MDBX_INTERNAL int osal_openfile(const enum osal_openfile_purpose purpose, const assert(stub_fd2 == -1); *fd = dup(stub_fd2 = *fd); } + const int err = errno; if (stub_fd0 != -1) close(stub_fd0); if (stub_fd1 != -1) @@ -1361,7 +1362,7 @@ MDBX_INTERNAL int osal_openfile(const enum osal_openfile_purpose purpose, const #endif /* STDIN_FILENO == 0 && STDERR_FILENO == 2 */ if (*fd < 0) - return errno; + return err; #if defined(FD_CLOEXEC) && !defined(O_CLOEXEC) const int fd_flags = fcntl(*fd, F_GETFD);