aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-07 03:47:51 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-07 03:47:51 +0000
commitc3b4966d7533eaf545b2d01be313d78e5e80f241 (patch)
treec8cc9618e6068f207c6a87e9db447d8c1afe49b9
parent064aa8fc002d00ef576a331de208b01e9b0feb81 (diff)
downloadnewlib-github/unlabeled-1.13.2.zip
newlib-github/unlabeled-1.13.2.tar.gz
newlib-github/unlabeled-1.13.2.tar.bz2
* include/cygwin/version.h: Bump API minor number for below export.github/unlabeled-1.13.2unlabeled-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 8a9f27e..f2e5e21 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)