From 433b2e494d6db83292886fe6922e26d25ed00f3c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 6 Jul 2002 06:11:53 +0000 Subject: * path.cc (suffix_scan::has): Reorganize to eliminate double scanning for for .exe (in the typical case). * fhandler_socket.cc (fhandler_socket::set_sun_path): Don't free memory here. Allow NULL parameter. * fhandler_socket.cc (fhandler_socket::dup): Add missing copy operation on sun_path. --- winsup/cygwin/fhandler_socket.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index ffae6b1..7970e4b 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -286,6 +286,8 @@ fhandler_socket::dup (fhandler_base *child) fhandler_socket *fhs = (fhandler_socket *) child; fhs->addr_family = addr_family; fhs->set_io_handle (get_io_handle ()); + if (get_addr_family () == AF_LOCAL) + fhs->set_sun_path (get_sun_path ()); fhs->fixup_before_fork_exec (GetCurrentProcessId ()); if (winsock2_active) @@ -1139,7 +1141,5 @@ fhandler_socket::set_close_on_exec (int val) void fhandler_socket::set_sun_path (const char *path) { - if (sun_path) - cfree (sun_path); - sun_path = cstrdup (path); + sun_path = path ? cstrdup (path) : NULL; } -- cgit v1.1