* fhandler.cc (fhandler_base::write): Use bool parameter in calls to
set_did_lseek. (fhandler_base::fhandler_base): Accomodate new status and open_status constructor. * fhandler.h: Remove status bit enumerator. (FHDEVN): Remove. (FHISSETF): Remove. (FHSETF): Remove. (FHCLEARF): Remove. (FHCONDSETF): Remove. (FHSTATOFF): Remove. (UNCONNECTED, CONNECT_PENDING, CONNECTED): Substitute by enum connect_state. (fhandler_base::status): Define as bitfield struct type status_flags. Remove unused flags entirely. Accomodate all status access methods. (open_status): Define as bitfield struct type status_flags. (fhandler_socket): Move socket related status bits to here. Redefine had_connect_or_listen to be part of these status bits. Accomodate related access methods. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use pc.issymlink instead of dropped method get_symlink_p. (fhandler_base::open_fs): Remove setting dropped status flags. * fhandler_socket.cc: Use values from enum connect_state throughout. (fhandler_socket::fhandler_socket): Initialize status bits. * fhandler_virtual.cc (fhandler_virtual::open): Remove setting dropped status flags. * net.cc: Use values from enum connect_state throughout. * select.cc: Ditto. * shared_info.h: Protect struct console_state using _FHANDLER_H_ instead of FHDEVN.
This commit is contained in:
@ -296,7 +296,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
|
||||
&buf->st_mode, &buf->st_uid, &buf->st_gid))
|
||||
{
|
||||
/* If read-only attribute is set, modify ntsec return value */
|
||||
if (pc.has_attribute (FILE_ATTRIBUTE_READONLY) && !get_symlink_p ())
|
||||
if (pc.has_attribute (FILE_ATTRIBUTE_READONLY) && !pc.issymlink ())
|
||||
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
|
||||
|
||||
if (!(buf->st_mode & S_IFMT))
|
||||
@ -339,7 +339,6 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
|
||||
if (ReadFile (get_handle (), magic, 3, &done, NULL)
|
||||
&& has_exec_chars (magic, done))
|
||||
{
|
||||
set_execable_p ();
|
||||
pc.set_exec ();
|
||||
buf->st_mode |= STD_XBITS;
|
||||
}
|
||||
@ -416,9 +415,6 @@ fhandler_base::open_fs (int flags, mode_t mode)
|
||||
set_file_attribute (has_acls (), get_win32_name (), mode);
|
||||
|
||||
set_fs_flags (pc.fs_flags ());
|
||||
set_symlink_p (pc.issymlink ());
|
||||
set_execable_p (pc.exec_state ());
|
||||
set_socket_p (pc.issocket ());
|
||||
|
||||
out:
|
||||
syscall_printf ("%d = fhandler_disk_file::open (%s, %p)", res,
|
||||
|
Reference in New Issue
Block a user