* Use new unified status_flag accessor methods from classes fhandler_*,

tty_min, mtinfo and fs_info thoroughout.
	* fhandler.h: Redefine all set_close_on_exec methods to take a bool
	argument.
	(enum conn_state): Rename from connect_state.
	(class fhandler_base): Rename some status flags to align with
	accessor method names.  Drop encoded flag entirely.  Unify status
	accessor methods.  Const'ify all read accessor methods.
	(class fhandler_socket): Ditto.
	(class fhandler_dev_raw): Ditto.
	* fhandler_disk_file.cc (fhandler_base::fstat_fs): Use fs.fs_is_fat()
	instead of evaluating FATness of file system here.
	(fhandler_disk_file::opendir): Drop call to set_encoded().
	(fhandler_disk_file::readdir): Use pc.isencoded() directly.
	* mtinfo.h (class mtinfo_drive): Const'ify all read accessor methods.
	* path.cc (fsinfo_cnt): Add.
	(fs_info::update): Accomodate class changes. Evaluate file system
	name specific flags right here. Add thread safety for reading and
	writing global fsinfo array.
	* path.h (enum path_types): Drop values for flags kept in fs already.
	(struct fs_info): Move status informatin into private struct type
	status_flags.  Add accessor methods. Remove path and file system
	name string arrays in favor of status bits.
	(class path_conv): Use new fs_info status information where
	appropriate.
	(path_conf::fs_has_ea): Rename from fs_fast_ea.
	(path_conf::fs_has_acls): New method.
	(path_conf::root_dir): Remove.
	(path_conf::volname): Remove.
	* syscalls (statfs): Evaluate root dir locally.
	* tty.h (class tty_min): Unify status accessor methods.  Const'ify
	all read accessor methods.
This commit is contained in:
Corinna Vinschen
2004-04-10 13:45:10 +00:00
parent 56a188d1f3
commit 56551a9bfb
29 changed files with 341 additions and 292 deletions

View File

@@ -484,7 +484,7 @@ dtable::dup_worker (fhandler_base *oldfh)
return NULL;
}
newfh->set_close_on_exec_flag (0);
newfh->close_on_exec (false);
MALLOC_CHECK;
debug_printf ("duped '%s' old %p, new %p", oldfh->get_name (), oldfh->get_io_handle (), newfh->get_io_handle ());
return newfh;
@@ -639,7 +639,7 @@ dtable::fixup_before_exec (DWORD target_proc_id)
lock ();
fhandler_base *fh;
for (size_t i = 0; i < size; i++)
if ((fh = fds[i]) != NULL && !fh->get_close_on_exec ())
if ((fh = fds[i]) != NULL && !fh->close_on_exec ())
{
debug_printf ("fd %d (%s)", i, fh->get_name ());
fh->fixup_before_fork_exec (target_proc_id);
@@ -668,7 +668,7 @@ dtable::fixup_after_exec ()
if ((fh = fds[i]) != NULL)
{
fh->clear_readahead ();
if (fh->get_close_on_exec ())
if (fh->close_on_exec ())
{
if (fh->archetype)
fh->close ();
@@ -693,7 +693,7 @@ dtable::fixup_after_fork (HANDLE parent)
for (size_t i = 0; i < size; i++)
if ((fh = fds[i]) != NULL)
{
if (fh->get_close_on_exec () || fh->get_need_fork_fixup ())
if (fh->close_on_exec () || fh->need_fork_fixup ())
{
debug_printf ("fd %d (%s)", i, fh->get_name ());
fh->fixup_after_fork (parent);
@@ -727,7 +727,7 @@ dtable::vfork_child_dup ()
if (not_open (i))
continue;
else if ((newtable[i] = dup_worker (fds[i])) != NULL)
newtable[i]->set_close_on_exec (fds[i]->get_close_on_exec ());
newtable[i]->set_close_on_exec (fds[i]->close_on_exec ());
else
{
res = 0;
@@ -783,7 +783,7 @@ dtable::vfork_child_fixup ()
if ((fh = fds[i]) != NULL)
{
fh->clear_readahead ();
if (!fh->archetype && fh->get_close_on_exec ())
if (!fh->archetype && fh->close_on_exec ())
release (i);
else
{