Cygwin: FIFO: fstatvfs: use our handle if O_PATH is set
If O_PATH is set, then the fhandler_fifo object has a handle that can be used for getting the statvfs information. Use it by calling fhandler_base::fstatvfs_by_handle. Before this change, fhandler_disk_file::fstatfvs was called on a new fhandler_disk_file object, which would then have to be opened.
This commit is contained in:
parent
68b7a457f7
commit
13d75fce48
|
@ -906,6 +906,14 @@ errout:
|
|||
int __reg2
|
||||
fhandler_fifo::fstatvfs (struct statvfs *sfs)
|
||||
{
|
||||
if (get_flags () & O_PATH)
|
||||
/* We already have a handle. */
|
||||
{
|
||||
HANDLE h = get_handle ();
|
||||
if (h)
|
||||
return fstatvfs_by_handle (h, sfs);
|
||||
}
|
||||
|
||||
fhandler_disk_file fh (pc);
|
||||
fh.get_device () = FH_FS;
|
||||
return fh.fstatvfs (sfs);
|
||||
|
|
Loading…
Reference in New Issue