Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Scott <conrad.scott@dsl.pipex.com>2002-07-14 16:26:17 +0400
committerConrad Scott <conrad.scott@dsl.pipex.com>2002-07-14 16:26:17 +0400
commit7ce3f8dd3694c203f2a2f5c33cdaa0d8d3e50886 (patch)
tree6570db8eaa266febb9bdb861f81b256c6dda866f
parent66124552759e3d7661a33b69f0d12c2e4a686c4e (diff)
* cygserver_transport_pipes.cc
(transport_layer_pipes::connect): Use ProtectHandle in DLL code. (transport_layer_pipes::close): Use ForceCloseHandle in DLL code.
-rw-r--r--winsup/cygwin/ChangeLog6
-rwxr-xr-xwinsup/cygwin/cygserver_transport_pipes.cc18
2 files changed, 19 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 28b80df2d..da8a30740 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-14 Conrad Scott <conrad.scott@dsl.pipex.com>
+
+ * cygserver_transport_pipes.cc
+ (transport_layer_pipes::connect): Use ProtectHandle in DLL code.
+ (transport_layer_pipes::close): Use ForceCloseHandle in DLL code.
+
2002-07-13 Christopher Faylor <cgf@redhat.com>
* dcrt0.cc (dll_crt0_1): Delay closing of some handles until cygheap
diff --git a/winsup/cygwin/cygserver_transport_pipes.cc b/winsup/cygwin/cygserver_transport_pipes.cc
index 2ea0cdbd5..5156fab40 100755
--- a/winsup/cygwin/cygserver_transport_pipes.cc
+++ b/winsup/cygwin/cygserver_transport_pipes.cc
@@ -174,7 +174,7 @@ transport_layer_pipes::accept (bool *const recoverable)
#endif /* !__INSIDE_CYGWIN__ */
void
-transport_layer_pipes::close()
+transport_layer_pipes::close ()
{
// verbose: debug_printf ("closing pipe %p", pipe);
@@ -182,9 +182,10 @@ transport_layer_pipes::close()
{
assert (pipe != INVALID_HANDLE_VALUE);
+#ifndef __INSIDE_CYGWIN__
+
if (is_accepted_endpoint)
{
-#ifndef __INSIDE_CYGWIN__
(void) FlushFileBuffers (pipe); // Blocks until client reads.
(void) DisconnectNamedPipe (pipe);
EnterCriticalSection (&pipe_instance_lock);
@@ -192,13 +193,17 @@ transport_layer_pipes::close()
assert (pipe_instance > 0);
InterlockedDecrement (&pipe_instance);
LeaveCriticalSection (&pipe_instance_lock);
-#else /* __INSIDE_CYGWIN__ */
- assert (false);
-#endif /* __INSIDE_CYGWIN__ */
}
else
(void) CloseHandle (pipe);
+#else /* __INSIDE_CYGWIN__ */
+
+ assert (!is_accepted_endpoint);
+ (void) ForceCloseHandle (pipe);
+
+#endif /* __INSIDE_CYGWIN__ */
+
pipe = NULL;
}
}
@@ -289,6 +294,9 @@ transport_layer_pipes::connect ()
if (pipe != INVALID_HANDLE_VALUE)
{
assert (pipe);
+#ifdef __INSIDE_CYGWIN__
+ ProtectHandle (pipe);
+#endif
assume_cygserver = true;
return true;
}