summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket_unix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket_unix.cc')
-rw-r--r--winsup/cygwin/fhandler_socket_unix.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc
index e08e9bdd9..573864b9f 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@ -2395,10 +2395,12 @@ fhandler_socket_unix::fchmod (mode_t newmode)
int
fhandler_socket_unix::fchown (uid_t uid, gid_t gid)
{
- if (sun_path ()
- && (sun_path ()->un_len <= (socklen_t) sizeof (sa_family_t)
- || sun_path ()->un.sun_path[0] == '\0'))
+ if (!dev ().isfs ())
+ /* fchown called on a socket. */
return fhandler_socket::fchown (uid, gid);
+
+ /* chown/lchown on a socket file. [We won't get here if fchown is
+ called on a socket opened w/ O_PATH.] */
fhandler_disk_file fh (pc);
return fh.fchown (uid, gid);
}