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-11-07 06:47:51 +0300
committerChristopher Faylor <me@cgf.cx>2002-11-07 06:47:51 +0300
commitc3b4966d7533eaf545b2d01be313d78e5e80f241 (patch)
treec8cc9618e6068f207c6a87e9db447d8c1afe49b9
parent064aa8fc002d00ef576a331de208b01e9b0feb81 (diff)
* include/cygwin/version.h: Bump API minor number for below export.unlabeled-1.13.2
* cygwin.din (pututline): New exported function. * syscalls.cc (login): Use pututiline(). (setutent): Open utmp as read/write. (endutent): Check if utmp file is open. (utmpname): call endutent() to close current utmp file. (getutid): Enable all cases, use strncmp() to compare ut_id fields. (pututline): New. * tty.cc (create_tty_master): Set ut_pid to current pid. * fhandler.h (fhandler_serial::vmin_): Declare as size_t. * fhandler_serial.cc (fhandler_serial::raw_read): Use correct type for minchars. (fhandler_serial::ioctl): Set errno if the ClearCommError fails. (fhandler_serial::tcsetattr): Use correct value for vmin_. (fhandler_serial::tcgetattr): Ditto. * fhandler_socket.cc (fhandler_socket::recvmsg): Call if from == NULL WSARecvFrom with fromlen = NULL.
-rw-r--r--winsup/cygwin/fhandler_registry.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc
index 8a9f27ed9..f2e5e2145 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -555,7 +555,7 @@ fhandler_registry::fill_filebuf ()
goto value_not_found;
}
bufalloc = size;
- filebuf = (char *) malloc (bufalloc);
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc);
error =
RegQueryValueEx (handle, value_name, NULL, NULL, (BYTE *) filebuf,
&size);
@@ -572,9 +572,14 @@ fhandler_registry::fill_filebuf ()
do
{
bufalloc += 1000;
- filebuf = (char *) realloc (filebuf, bufalloc);
- error = RegQueryValueEx (handle, value_name, NULL, &type,
- (BYTE *) filebuf, &size);
+ if (filebuf)
+ {
+ cfree (filebuf);
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc);
+ }
+ error =
+ RegQueryValueEx (handle, value_name, NULL, &type,
+ (BYTE *) filebuf, &size);
if (error != ERROR_SUCCESS && error != ERROR_MORE_DATA)
{
if (error != ERROR_FILE_NOT_FOUND)