aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-07 03:47:49 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-07 03:47:49 +0000
commit644c83bca346d7bb670e5467c1dcd2e1daa8ee3d (patch)
treeb66611e9301c769365338897230f4b74049719f4
parent6b2f7d302518abc09c15730353b6a0978a6adbf2 (diff)
downloadnewlib-unlabeled-1.18.2.zip
newlib-unlabeled-1.18.2.tar.gz
newlib-unlabeled-1.18.2.tar.bz2
* include/cygwin/version.h: Bump API minor number for below export.github/unlabeled-1.18.2unlabeled-1.18.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_proc.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index f887e8c..86c3c81 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -327,7 +327,7 @@ fhandler_proc::fill_filebuf ()
uname (&uts_name);
bufalloc = strlen (uts_name.sysname) + 1 + strlen (uts_name.release) +
1 + strlen (uts_name.version) + 2;
- filebuf = (char *) realloc (filebuf, bufalloc);
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc);
filesize = __small_sprintf (filebuf, "%s %s %s\n", uts_name.sysname,
uts_name.release, uts_name.version);
}
@@ -335,13 +335,15 @@ fhandler_proc::fill_filebuf ()
}
case PROC_UPTIME:
{
- filebuf = (char *) realloc (filebuf, bufalloc = 80);
+ if (!filebuf)
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 80);
filesize = format_proc_uptime (filebuf, bufalloc);
break;
}
case PROC_STAT:
{
- filebuf = (char *) realloc (filebuf, bufalloc = 2048);
+ if (!filebuf)
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048);
filesize = format_proc_stat (filebuf, bufalloc);
break;
}
@@ -352,14 +354,16 @@ fhandler_proc::fill_filebuf ()
* Windows 95/98/me does have the KERNEL/CPUUsage performance counter
* which is similar.
*/
- filebuf = (char *) realloc (filebuf, bufalloc = 16);
+ if (!filebuf)
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 16);
filesize = __small_sprintf (filebuf, "%u.%02u %u.%02u %u.%02u\n",
0, 0, 0, 0, 0, 0);
break;
}
case PROC_MEMINFO:
{
- filebuf = (char *) realloc (filebuf, bufalloc = 2048);
+ if (!filebuf)
+ filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048);
filesize = format_proc_meminfo (filebuf, bufalloc);
break;
}