aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-07-26 19:22:24 +0000
committerChristopher Faylor <me@cgf.cx>2001-07-26 19:22:24 +0000
commit6b91b8d53be5b2333c3a8909d48a7a603aae4177 (patch)
tree060507f0ad7dac4b9a88696268df574996feb1dc /winsup/cygwin/fhandler_socket.cc
parentc784c833aa9313a233a493cdb9e28f69fa7d360d (diff)
downloadnewlib-6b91b8d53be5b2333c3a8909d48a7a603aae4177.zip
newlib-6b91b8d53be5b2333c3a8909d48a7a603aae4177.tar.gz
newlib-6b91b8d53be5b2333c3a8909d48a7a603aae4177.tar.bz2
Throughout, reorganize header file inclusion to put security.h prior to
fhandler.h. * fhandler.h (fhandler_base::get_inheritance): New method. * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper close-on-exec inheritance when creating. (fhandler_socket::check_peer_secret_event): Create handle as non-inheritable.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 974f2de..13cbe9f 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -23,6 +23,7 @@
#define USE_SYS_TYPES_FD_SET
#include <winsock2.h>
#include "cygerrno.h"
+#include "security.h"
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
@@ -98,7 +99,7 @@ fhandler_socket::create_secret_event (int* secret)
__small_sprintf (buf, SECRET_EVENT_NAME, sin.sin_port,
secret_ptr [0], secret_ptr [1],
secret_ptr [2], secret_ptr [3]);
- secret_event = CreateEvent ( NULL, FALSE, FALSE, buf);
+ secret_event = CreateEvent (get_inheritance (), FALSE, FALSE, buf);
if (!secret_event && GetLastError () == ERROR_ALREADY_EXISTS)
secret_event = OpenEvent (EVENT_ALL_ACCESS, FALSE, buf);
@@ -133,7 +134,7 @@ fhandler_socket::check_peer_secret_event (struct sockaddr_in* peer, int* secret)
__small_sprintf (buf, SECRET_EVENT_NAME, peer->sin_port,
secret_ptr [0], secret_ptr [1],
secret_ptr [2], secret_ptr [3]);
- ev = CreateEvent (NULL, FALSE, FALSE, buf);
+ ev = CreateEvent (&sec_none_nih, FALSE, FALSE, buf);
if (!ev && GetLastError () == ERROR_ALREADY_EXISTS)
{
debug_printf ("%s event already exist");