2003-05-20 Corinna Vinschen <corinna@vinschen.de>
+ * fhandler_socket.cc (secret_event_name): Return void. Use incoming
+ char *parameter instead of local static buffer.
+ (fhandler_socket::create_secret_event): Accomodate new calling
+ convention for secret_event_name.
+ (fhandler_socket::close_secret_event): Ditto.
+
+2003-05-20 Corinna Vinschen <corinna@vinschen.de>
+
* fhandler_socket.cc (SECRET_EVENT_NAME): Remove.
(ENTROPY_SOURCE_NAME): Ditto.
(secret_event_name): New static function. Create shared event name
fhandler_dev_random* entropy_source;
-static char *
-secret_event_name (short port, int *secret_ptr)
+static void
+secret_event_name (char *buf, short port, int *secret_ptr)
{
- static NO_COPY char buf[MAX_PATH] = {0};
-
__small_sprintf (buf, "%scygwin.local_socket.secret.%d.%08x-%08x-%08x-%08x",
wincap.has_terminal_services () ? "Global\\" : "",
port,
secret_ptr [0], secret_ptr [1],
secret_ptr [2], secret_ptr [3]);
- return buf;
}
/* cygwin internal: map sockaddr into internet domain address */
return NULL;
}
- char *event_name = secret_event_name (sin.sin_port,
- secret ?: connect_secret);
+ char event_name[MAX_PATH];
+ secret_event_name (event_name, sin.sin_port, secret ?: connect_secret);
LPSECURITY_ATTRIBUTES sec = get_inheritance (true);
secret_event = CreateEvent (sec, FALSE, FALSE, event_name);
if (!secret_event && GetLastError () == ERROR_ALREADY_EXISTS)
int
fhandler_socket::check_peer_secret_event (struct sockaddr_in* peer, int* secret)
{
- char *event_name = secret_event_name (peer->sin_port,
- secret ?: connect_secret);
+
+ char event_name[MAX_PATH];
+
+ secret_event_name (event_name, peer->sin_port, secret ?: connect_secret);
HANDLE ev = CreateEvent (&sec_all_nih, FALSE, FALSE, event_name);
if (!ev && GetLastError () == ERROR_ALREADY_EXISTS)
{