Cygwin: [gs]et_io_handle(): renamed to [gs]et_handle().

- Unify get_io_handle() and get_handle() to get_handle().
  Both of them returned same value; io_handle.
- Rename set_io_handle() to set_handle().
This commit is contained in:
Takashi Yano
2019-03-30 16:12:02 +09:00
committed by Corinna Vinschen
parent 023c107a22
commit a9c661a94d
14 changed files with 87 additions and 86 deletions

View File

@@ -647,7 +647,7 @@ build_fh_pc (path_conv& pc)
else if ((fh->archetype = cygheap->fdtab.find_archetype (fh->dev ())))
{
debug_printf ("found an archetype for %s(%d/%d) io_handle %p", fh->get_name (), fh->dev ().get_major (), fh->dev ().get_minor (),
fh->archetype->get_io_handle ());
fh->archetype->get_handle ());
if (!fh->get_name ())
fh->set_name (fh->archetype->dev ().name ());
}
@@ -688,7 +688,7 @@ dtable::dup_worker (fhandler_base *oldfh, int flags)
else
{
if (!oldfh->archetype)
newfh->set_io_handle (NULL);
newfh->set_handle (NULL);
newfh->pc.reset_conv_handle ();
if (oldfh->dup (newfh, flags))
@@ -708,7 +708,7 @@ dtable::dup_worker (fhandler_base *oldfh, int flags)
/* The O_CLOEXEC flag enforces close-on-exec behaviour. */
newfh->set_close_on_exec (!!(flags & O_CLOEXEC));
debug_printf ("duped '%s' old %p, new %p", oldfh->get_name (),
oldfh->get_io_handle (), newfh->get_io_handle ());
oldfh->get_handle (), newfh->get_handle ());
}
}
return newfh;
@@ -765,7 +765,7 @@ dtable::dup3 (int oldfd, int newfd, int flags)
}
debug_printf ("newfh->io_handle %p, oldfh->io_handle %p, new win32_name %p, old win32_name %p",
newfh->get_io_handle (), fds[oldfd]->get_io_handle (), newfh->get_win32_name (), fds[oldfd]->get_win32_name ());
newfh->get_handle (), fds[oldfd]->get_handle (), newfh->get_win32_name (), fds[oldfd]->get_win32_name ());
if (!not_open (newfd))
close (newfd);
@@ -891,12 +891,12 @@ dtable::fixup_after_exec ()
/* Close the handle if it's close-on-exec or if an error was detected
(typically with opening a console in a gui app) by fixup_after_exec.
*/
if (fh->close_on_exec () || (!fh->nohandle () && !fh->get_io_handle ()))
if (fh->close_on_exec () || (!fh->nohandle () && !fh->get_handle ()))
fixup_close (i, fh);
else if (fh->get_popen_pid ())
close (i);
else if (i == 0)
SetStdHandle (std_consts[i], fh->get_io_handle ());
SetStdHandle (std_consts[i], fh->get_handle ());
else if (i <= 2)
SetStdHandle (std_consts[i], fh->get_output_handle ());
}
@@ -913,7 +913,7 @@ dtable::fixup_after_fork (HANDLE parent)
{
debug_printf ("fd %d (%s)", i, fh->get_name ());
fh->fixup_after_fork (parent);
if (!fh->nohandle () && !fh->get_io_handle ())
if (!fh->nohandle () && !fh->get_handle ())
{
/* This should actually never happen but it's here to make sure
we don't crash due to access of an unopened file handle. */
@@ -922,7 +922,7 @@ dtable::fixup_after_fork (HANDLE parent)
}
}
if (i == 0)
SetStdHandle (std_consts[i], fh->get_io_handle ());
SetStdHandle (std_consts[i], fh->get_handle ());
else if (i <= 2)
SetStdHandle (std_consts[i], fh->get_output_handle ());
}