summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/fhandler_socket_local.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_socket_local.cc b/winsup/cygwin/fhandler_socket_local.cc
index e7f4fe603..76815a611 100644
--- a/winsup/cygwin/fhandler_socket_local.cc
+++ b/winsup/cygwin/fhandler_socket_local.cc
@@ -675,6 +675,13 @@ fhandler_socket_local::fstatvfs (struct statvfs *sfs)
{
if (get_sun_path () && get_sun_path ()[0] == '\0')
return fhandler_socket_wsock::fstatvfs (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);