* 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.
This commit is contained in:
Corinna Vinschen 2007-08-16 16:59:25 +00:00
parent 29992bf3da
commit f4c963630e
3 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,10 @@
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.

View File

@ -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;

View File

@ -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);