Win32: removed attempt to use a drive letter in ngx_fs_bsize().

Just a drive letter might not correctly represent file system being used,
notably when using symlinks (as created by "mklink /d").  As such, instead
of trying to call GetDiskFreeSpace() with just a drive letter, we now always
use GetDiskFreeSpace() with full path.

Further, it looks like the code to use just a drive letter never worked,
since it tried to test name[2] instead of name[1] to be ':'.
This commit is contained in:
Maxim Dounin 2023-02-23 20:50:00 +03:00
parent 5a81048cd8
commit acf3f86572
1 changed files with 0 additions and 6 deletions

View File

@ -967,14 +967,8 @@ ngx_directio_off(ngx_fd_t fd)
size_t
ngx_fs_bsize(u_char *name)
{
u_char root[4];
u_long sc, bs, nfree, ncl;
if (name[2] == ':') {
ngx_cpystrn(root, name, 4);
name = root;
}
if (GetDiskFreeSpace((const char *) name, &sc, &bs, &nfree, &ncl) == 0) {
return 512;
}