summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-07-27 11:02:57 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-07-27 11:02:57 +0200
commit3bb36e949534fc4a24d68d4297663ae8b80ba336 (patch)
tree09907f6c2e82d718f261323075ffb33cb350fef7 /mysys
parent9a897335eb4387980aed7698b832a893dbaa3d81 (diff)
parentbd935a41060199a17019453d6e187e8edd7929ba (diff)
downloadmariadb-git-3bb36e949534fc4a24d68d4297663ae8b80ba336.tar.gz
Merge branch '10.3' into 10.4
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 0c76eb25560..0baca6d62d7 100644
--- a/mysys/my_winfile.c
+++ b/mysys/my_winfile.c
@@ -250,13 +250,12 @@ File my_win_sopen(const char *path, int oflag, int shflag, int pmode)
if ((osfh= CreateFile(path, fileaccess, fileshare, &SecurityAttributes,
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,