mirror of
https://github.com/nginx/nginx.git
synced 2025-01-05 05:34:56 -06:00
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:
parent
2062ddef39
commit
6c5fe80bc6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user