diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-03-20 01:37:10 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-03-20 01:37:10 +0000 |
commit | 211496566bf99ace06427acd2fccc3aa85d4d19c (patch) | |
tree | 49686c11f98c87c34da0f10b077e0275c0ec1a0c /gdb/procfs.c | |
parent | 365f67c1fd2c8d32730c6715e0034372402e7e2e (diff) | |
download | gdb-211496566bf99ace06427acd2fccc3aa85d4d19c.tar.gz |
malloc() -> xmalloc.
Move malloc() decl to utils.c
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index 8586238650d..94439e3a4dd 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__); |