diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-08-16 16:59:25 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-08-16 16:59:25 +0000 |
commit | f4c963630ea50959fcbd55d897defb4fafdb45eb (patch) | |
tree | 7961d6db376843a2ad7983b0dce8ba060807afe4 | |
parent | 29992bf3dad77669ffbedd92d3075a5fb1b1a1ae (diff) | |
download | newlib-f4c963630ea50959fcbd55d897defb4fafdb45eb.zip newlib-f4c963630ea50959fcbd55d897defb4fafdb45eb.tar.gz newlib-f4c963630ea50959fcbd55d897defb4fafdb45eb.tar.bz2 |
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCK
mode bit by setting the SYSTEM attribute.
* fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit
when calling fhandler_disk_file::fchmod. Don't set attributes here.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_socket.cc | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index aa24434..a6198ce 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2007-08-16 Corinna Vinschen <corinna@vinschen.de> + * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Handle S_IFSOCK + mode bit by setting the SYSTEM attribute. + * fhandler_socket.cc (fhandler_socket::fchmod): Add S_IFSOCK mode bit + when calling fhandler_disk_file::fchmod. Don't set attributes here. + +2007-08-16 Corinna Vinschen <corinna@vinschen.de> + * path.h (path_conv::operator char *): Delete. (path_conv::operator const char *): Delete. * dlfcn.cc: Throughout, replace path_conv::operator char * and diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index cccd440..3dfed5a 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -772,6 +772,8 @@ fhandler_disk_file::fchmod (mode_t mode) pc &= (DWORD) ~FILE_ATTRIBUTE_READONLY; else pc |= (DWORD) FILE_ATTRIBUTE_READONLY; + if (mode & S_IFSOCK) + pc |= (DWORD) FILE_ATTRIBUTE_SYSTEM; IO_STATUS_BLOCK io; FILE_BASIC_INFORMATION fbi; diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index a5a13d0..a901dfd 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -707,10 +707,7 @@ fhandler_socket::fchmod (mode_t mode) { fhandler_disk_file fh (pc); fh.get_device () = FH_FS; - int ret = fh.fchmod (adjust_socket_file_mode (mode)); - SetFileAttributesA (pc.get_win32 (), - GetFileAttributesA (pc.get_win32 ()) - | FILE_ATTRIBUTE_SYSTEM); + int ret = fh.fchmod (S_IFSOCK | adjust_socket_file_mode (mode)); return ret; } set_errno (EBADF); |