aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-07-06 06:11:53 +0000
committerChristopher Faylor <me@cgf.cx>2002-07-06 06:11:53 +0000
commit433b2e494d6db83292886fe6922e26d25ed00f3c (patch)
tree98721f932b99fa40ab0fc020fdb9be0811dc831b
parentd255da424277f17182aa47fa869bd312396b03b4 (diff)
downloadnewlib-github/unlabeled-1.50.2.zip
newlib-github/unlabeled-1.50.2.tar.gz
newlib-github/unlabeled-1.50.2.tar.bz2
* path.cc (suffix_scan::has): Reorganize to eliminate double scanning for forgithub/unlabeled-1.50.2unlabeled-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 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;
}