public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Ken Brown <kbrown@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: FIFO: minor change - use NtClose
Date: Fri, 8 May 2020 11:29:06 +0000 (GMT) [thread overview]
Message-ID: <20200508112907.09FC53851C1E@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d05124dc6beb1379c155bfa0fe5e3bd42a28f280
commit d05124dc6beb1379c155bfa0fe5e3bd42a28f280
Author: Ken Brown <kbrown@cornell.edu>
Date: Tue Mar 17 10:36:34 2020 -0400
Cygwin: FIFO: minor change - use NtClose
Replace CloseHandle by NtClose since all handles are created by NT
functions.
Diff:
---
winsup/cygwin/fhandler_fifo.cc | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 19cd0e507..c091b0add 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -319,7 +319,7 @@ fhandler_fifo::listen_client ()
__seterrno ();
HANDLE evt = InterlockedExchangePointer (&lct_termination_evt, NULL);
if (evt)
- CloseHandle (evt);
+ NtClose (evt);
return false;
}
return true;
@@ -441,7 +441,7 @@ fhandler_fifo::listen_client_thread ()
ret = -1;
}
if (ph)
- CloseHandle (ph);
+ NtClose (ph);
fifo_client_unlock ();
goto out;
default:
@@ -462,7 +462,7 @@ fhandler_fifo::listen_client_thread ()
}
out:
if (evt)
- CloseHandle (evt);
+ NtClose (evt);
ResetEvent (read_ready);
if (ret < 0)
debug_printf ("exiting with error, %E");
@@ -617,16 +617,16 @@ out:
{
if (read_ready)
{
- CloseHandle (read_ready);
+ NtClose (read_ready);
read_ready = NULL;
}
if (write_ready)
{
- CloseHandle (write_ready);
+ NtClose (write_ready);
write_ready = NULL;
}
if (get_handle ())
- CloseHandle (get_handle ());
+ NtClose (get_handle ());
if (listen_client_thr)
stop_listen_client ();
}
@@ -775,7 +775,7 @@ fhandler_fifo::raw_write (const void *ptr, size_t len)
ret = nbytes;
}
if (evt)
- CloseHandle (evt);
+ NtClose (evt);
if (status == STATUS_THREAD_SIGNALED && ret < 0)
set_errno (EINTR);
else if (status == STATUS_THREAD_CANCELED)
@@ -819,7 +819,7 @@ fhandler_fifo::check_listen_client_thread ()
switch (waitret)
{
case WAIT_OBJECT_0:
- CloseHandle (listen_client_thr);
+ NtClose (listen_client_thr);
break;
case WAIT_TIMEOUT:
ret = 1;
@@ -828,7 +828,7 @@ fhandler_fifo::check_listen_client_thread ()
debug_printf ("WaitForSingleObject failed, %E");
ret = -1;
__seterrno ();
- CloseHandle (listen_client_thr);
+ NtClose (listen_client_thr);
break;
}
}
@@ -1001,11 +1001,11 @@ fhandler_fifo::stop_listen_client ()
ret = -1;
debug_printf ("listen_client_thread exited with error");
}
- CloseHandle (thr);
+ NtClose (thr);
}
evt = InterlockedExchangePointer (&lct_termination_evt, NULL);
if (evt)
- CloseHandle (evt);
+ NtClose (evt);
return ret;
}
@@ -1017,9 +1017,9 @@ fhandler_fifo::close ()
fifo_client_unlock ();
int ret = stop_listen_client ();
if (read_ready)
- CloseHandle (read_ready);
+ NtClose (read_ready);
if (write_ready)
- CloseHandle (write_ready);
+ NtClose (write_ready);
fifo_client_lock ();
for (int i = 0; i < nhandlers; i++)
if (fc_handler[i].close () < 0)
@@ -1070,7 +1070,7 @@ fhandler_fifo::dup (fhandler_base *child, int flags)
GetCurrentProcess (), &fhf->write_ready,
0, true, DUPLICATE_SAME_ACCESS))
{
- CloseHandle (fhf->read_ready);
+ NtClose (fhf->read_ready);
fhf->close ();
__seterrno ();
goto out;
@@ -1084,8 +1084,8 @@ fhandler_fifo::dup (fhandler_base *child, int flags)
0, true, DUPLICATE_SAME_ACCESS))
{
fifo_client_unlock ();
- CloseHandle (fhf->read_ready);
- CloseHandle (fhf->write_ready);
+ NtClose (fhf->read_ready);
+ NtClose (fhf->write_ready);
fhf->close ();
__seterrno ();
goto out;
reply other threads:[~2020-05-08 11:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200508112907.09FC53851C1E@sourceware.org \
--to=kbrown@sourceware.org \
--cc=cygwin-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).