summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 18:26:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 18:26:21 +0300
commit742e1c727fc2be50b758068c2ab92abb19f3ff56 (patch)
treeb4efffa4eade915001faf0ceaf50715306416907 /mysys
parent19283c67c6d196a49211da6f925ca59fceef3ea0 (diff)
parent30914389fe9ca13cf29470dd033a5cf6997a3931 (diff)
downloadmariadb-git-742e1c727fc2be50b758068c2ab92abb19f3ff56.tar.gz
Merge 10.6 into 10.7
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_winfile.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mysys/my_winfile.c b/mysys/my_winfile.c
index 70131896d59..b4c32ade906 100644
--- a/mysys/my_winfile.c
+++ b/mysys/my_winfile.c
@@ -265,13 +265,12 @@ File my_win_sopen(const char *path, int oflag, int shflag, int pmode)
if ((osfh= CreateFile(path, fileaccess, fileshare,my_win_file_secattr(),
filecreate, fileattrib, NULL)) == INVALID_HANDLE_VALUE)
{
- /*
- OS call to open/create file failed! map the error, release
- the lock, and return -1. note that it's not necessary to
- call _free_osfhnd (it hasn't been used yet).
- */
- my_osmaperr(GetLastError()); /* map error */
- DBUG_RETURN(-1); /* return error to caller */
+ DWORD last_error= GetLastError();
+ if (last_error == ERROR_PATH_NOT_FOUND && strlen(path) >= MAX_PATH)
+ errno= ENAMETOOLONG;
+ else
+ my_osmaperr(last_error); /* map error */
+ DBUG_RETURN(-1);
}
if ((fh= my_open_osfhandle(osfh,