summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-14 04:01:32 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-14 04:01:32 +0000
commit8bce0d723c50924b908dca1467037c8008e872be (patch)
treedcaf982175c090c0e7668af5fa00dac09fb07b27 /winsup/cygwin/fhandler_socket.cc
parentec085641a9b4d25e16df12d7449f7ad689934117 (diff)
downloadcygnal-8bce0d723c50924b908dca1467037c8008e872be.tar.gz
cygnal-8bce0d723c50924b908dca1467037c8008e872be.tar.bz2
cygnal-8bce0d723c50924b908dca1467037c8008e872be.zip
Throughout, change fhandler_*::read and fhandler_*::raw_read to void functions
whose second arguments are both the lenght and the return value. * fhandler.cc (fhandler_base::read): Rework slightly to use second argument as input/output. Tweak CRLF stuff. (fhandler_base::readv): Accommodate fhandler_*::read changes. * cygthread.h (cygthread::detach): Declare as taking optional handle argument. (cygthread::detach): When given a handle argument, wait for the handle to be signalled before waiting for thread to detach. Return true when signal detected.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index fa44f2e03..33e795458 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -124,10 +124,13 @@ fhandler_socket::set_connect_secret ()
delete entropy_source;
entropy_source = NULL;
}
- if (!entropy_source ||
- (entropy_source->read (connect_secret, sizeof (connect_secret)) !=
- sizeof (connect_secret)))
- bzero ((char*) connect_secret, sizeof (connect_secret));
+ if (!entropy_source)
+ {
+ size_t len = sizeof (connect_secret);
+ entropy_source->read (connect_secret, len);
+ if (len != sizeof (connect_secret))
+ bzero ((char*) connect_secret, sizeof (connect_secret));
+ }
}
void