diff options
Diffstat (limited to 'winsup/cygwin/fhandler_proc.cc')
-rw-r--r-- | winsup/cygwin/fhandler_proc.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc index 86c3c81fb..f887e8cb7 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 *) cmalloc (HEAP_BUF, bufalloc); + filebuf = (char *) realloc (filebuf, bufalloc); filesize = __small_sprintf (filebuf, "%s %s %s\n", uts_name.sysname, uts_name.release, uts_name.version); } @@ -335,15 +335,13 @@ fhandler_proc::fill_filebuf () } case PROC_UPTIME: { - if (!filebuf) - filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 80); + filebuf = (char *) realloc (filebuf, bufalloc = 80); filesize = format_proc_uptime (filebuf, bufalloc); break; } case PROC_STAT: { - if (!filebuf) - filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048); + filebuf = (char *) realloc (filebuf, bufalloc = 2048); filesize = format_proc_stat (filebuf, bufalloc); break; } @@ -354,16 +352,14 @@ fhandler_proc::fill_filebuf () * Windows 95/98/me does have the KERNEL/CPUUsage performance counter * which is similar. */ - if (!filebuf) - filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 16); + filebuf = (char *) realloc (filebuf, bufalloc = 16); filesize = __small_sprintf (filebuf, "%u.%02u %u.%02u %u.%02u\n", 0, 0, 0, 0, 0, 0); break; } case PROC_MEMINFO: { - if (!filebuf) - filebuf = (char *) cmalloc (HEAP_BUF, bufalloc = 2048); + filebuf = (char *) realloc (filebuf, bufalloc = 2048); filesize = format_proc_meminfo (filebuf, bufalloc); break; } |