From b40c8769f2e4fb589de2263b7d8088d0c69ae6e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 09:34:16 +0200 Subject: Merging upstream version 1:0.1.9998svn3604+dfsg. Signed-off-by: Daniel Baumann --- src/lib/nt/ntopenat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/nt/ntopenat.c') diff --git a/src/lib/nt/ntopenat.c b/src/lib/nt/ntopenat.c index 6db4de7..07ae561 100644 --- a/src/lib/nt/ntopenat.c +++ b/src/lib/nt/ntopenat.c @@ -55,9 +55,10 @@ static int birdOpenInt(const char *pszPath, int fFlags, unsigned __int16 fMode) * directories as the CRT doesn't allow doing that. */ int const iErrnoSaved = errno; + int iErrno; int fd = open(pszPath, fFlags, fMode); if ( fd < 0 - && (errno == EACCES || errno == ENOENT || errno == EISDIR) + && ((iErrno = errno) == EACCES || iErrno == ENOENT || iErrno == EISDIR || iErrno == EINVAL /*CIFS*/) && (fFlags & (_O_WRONLY | _O_RDWR | _O_RDONLY)) == _O_RDONLY && (fFlags & (_O_CREAT | _O_TRUNC | _O_EXCL)) == 0 ) { -- cgit v1.2.3