* 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:
Corinna Vinschen
2004-04-09 08:43:29 +00:00
parent 00dd058f7e
commit b79f85c28b
9 changed files with 138 additions and 132 deletions

View File

@ -121,8 +121,12 @@ get_inet_addr (const struct sockaddr *in, int inlen,
/**********************************************************************/
/* fhandler_socket */
fhandler_socket::fhandler_socket ()
: fhandler_base (), sun_path (NULL)
fhandler_socket::fhandler_socket () :
fhandler_base (),
sun_path (NULL),
sock_saw_shut_rd (0),
sock_saw_shut_wr (0),
had_connect_or_listen (unconnected)
{
set_need_fork_fixup ();
prot_info_ptr = (LPWSAPROTOCOL_INFOA) cmalloc (HEAP_BUF,
@ -545,9 +549,9 @@ fhandler_socket::connect (const struct sockaddr *name, int namelen)
err = WSAGetLastError ();
if (err == WSAEINPROGRESS || err == WSAEALREADY)
set_connect_state (CONNECT_PENDING);
set_connect_state (connect_pending);
else
set_connect_state (CONNECTED);
set_connect_state (connected);
return res;
}
@ -559,7 +563,7 @@ fhandler_socket::listen (int backlog)
if (res)
set_winsock_errno ();
else
set_connect_state (CONNECTED);
set_connect_state (connected);
return res;
}
@ -634,7 +638,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
((fhandler_socket *) res_fd)->set_sun_path (get_sun_path ());
((fhandler_socket *) res_fd)->set_addr_family (get_addr_family ());
((fhandler_socket *) res_fd)->set_socket_type (get_socket_type ());
((fhandler_socket *) res_fd)->set_connect_state (CONNECTED);
((fhandler_socket *) res_fd)->set_connect_state (connected);
res = res_fd;
}
else