diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index cb2779432..f24c3f3b1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Thu May 31 15:57:57 2001 Christopher Faylor + + * fhandler.cc (fhandler_disk_file::fstat): Avoid clearing S_IFMT bits + since we've already pre-cleared everything anyway. + Wed May 30 23:51:32 2001 Earnie Boyd * path.cc (chdir): Always send unsigned chars to isspace since newlib's diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 4b042b285..15e0e2303 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -938,8 +938,9 @@ fhandler_disk_file::fstat (struct stat *buf) && !get_symlink_p ()) buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); - buf->st_mode &= ~S_IFMT; - if (get_socket_p ()) + if (buf->st_mode & S_IFMT) + /* already set */; + else if (get_socket_p ()) buf->st_mode |= S_IFSOCK; else if (local.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) buf->st_mode |= S_IFDIR; @@ -954,7 +955,9 @@ fhandler_disk_file::fstat (struct stat *buf) buf->st_mode |= STD_WBITS; /* | S_IWGRP | S_IWOTH; we don't give write to group etc */ - if (get_socket_p ()) + if (buf->st_mode & S_IFMT) + /* already set */; + else if (get_socket_p ()) buf->st_mode |= S_IFSOCK; else switch (GetFileType (get_handle ()))