aboutsummaryrefslogtreecommitdiff
path: root/gdb/procfs.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-03-20 01:37:10 +0000
committerAndrew Cagney <cagney@redhat.com>2001-03-20 01:37:10 +0000
commit3c37485b16d873d9fd8d5d448dce60a2d890e286 (patch)
tree01b974afe0c43b13dc0a0efda5ce8f0cf4b1a6a4 /gdb/procfs.c
parent0e52036f1f47078a9863f6a377ff11e10a81e8c4 (diff)
downloadgdb-3c37485b16d873d9fd8d5d448dce60a2d890e286.zip
gdb-3c37485b16d873d9fd8d5d448dce60a2d890e286.tar.gz
gdb-3c37485b16d873d9fd8d5d448dce60a2d890e286.tar.bz2
malloc() -> xmalloc.
Move malloc() decl to utils.c
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r--gdb/procfs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 8586238..94439e3 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2876,9 +2876,7 @@ proc_update_threads (procinfo *pi)
if ((nlwp = proc_get_nthreads (pi)) <= 1)
return 1; /* Process is not multi-threaded; nothing to do. */
- if ((prstatus = (gdb_prstatus_t *)
- malloc (sizeof (gdb_prstatus_t) * (nlwp + 1))) == 0)
- perror_with_name ("procfs: malloc failed in update_threads");
+ prstatus = xmalloc (sizeof (gdb_prstatus_t) * (nlwp + 1));
old_chain = make_cleanup (xfree, prstatus);
if (ioctl (pi->ctl_fd, PIOCLSTATUS, prstatus) < 0)
@@ -2984,8 +2982,7 @@ proc_update_threads (procinfo *pi)
if (nthreads < 2)
return 0; /* nothing to do for 1 or fewer threads */
- if ((threads = malloc (nthreads * sizeof (tid_t))) == NULL)
- proc_error (pi, "update_threads, malloc", __LINE__);
+ threads = xmalloc (nthreads * sizeof (tid_t));
if (ioctl (pi->ctl_fd, PIOCTLIST, threads) < 0)
proc_error (pi, "procfs: update_threads (PIOCTLIST)", __LINE__);