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:
authorChristopher Faylor <me@cgf.cx>2002-07-06 10:11:53 +0400
committerChristopher Faylor <me@cgf.cx>2002-07-06 10:11:53 +0400
commit433b2e494d6db83292886fe6922e26d25ed00f3c (patch)
tree98721f932b99fa40ab0fc020fdb9be0811dc831b
parentd255da424277f17182aa47fa869bd312396b03b4 (diff)
* path.cc (suffix_scan::has): Reorganize to eliminate double scanning for forunlabeled-1.50.2
.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.
-rw-r--r--winsup/cygwin/fhandler_socket.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index ffae6b1b8..7970e4b63 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;
}