aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/fhandler/base.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc
index 6163df2..cdef01a 100644
--- a/winsup/cygwin/fhandler/base.cc
+++ b/winsup/cygwin/fhandler/base.cc
@@ -1725,7 +1725,10 @@ int
fhandler_base::fchown (uid_t uid, gid_t gid)
{
if (pc.is_fs_special ())
- return ((fhandler_disk_file *) this)->fhandler_disk_file::fchown (uid, gid);
+ {
+ fhandler_disk_file fh (pc);
+ return fh.fchown (uid, gid);
+ }
/* By default, just succeeds. */
return 0;
}