diff options
author | Roland McGrath <roland@redhat.com> | 2007-01-11 05:15:56 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2007-01-11 05:15:56 +0000 |
commit | d39384c10b8cba1e1d583e65743a653ee6224320 (patch) | |
tree | 84188913bd877683c5ca7a4c43c9850d27c1c216 /libdwfl | |
parent | 44865b9e1e73f6c0e35c7d62a72cc73b513f65f0 (diff) | |
download | elfutils-d39384c10b8cba1e1d583e65743a653ee6224320.tar.gz |
Same as last commit, for linux-proc-maps.c
Diffstat (limited to 'libdwfl')
-rw-r--r-- | libdwfl/ChangeLog | 2 | ||||
-rw-r--r-- | libdwfl/linux-proc-maps.c | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 67ecfe7d..0439d4cf 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -6,6 +6,8 @@ (dwfl_linux_kernel_find_elf): Likewise. (dwfl_linux_kernel_module_section_address): Likewise. * find-debuginfo.c (try_open): Likewise. + * linux-proc-maps.c (find_sysinfo_ehdr): Likewise. + (dwfl_linux_proc_report): Likewise. * libdwfl.h (dwfl_begin): Require nonnull argument. diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c index 4b4dfc92..6eaed39a 100644 --- a/libdwfl/linux-proc-maps.c +++ b/libdwfl/linux-proc-maps.c @@ -1,5 +1,5 @@ /* Standard libdwfl callbacks for debugging a live Linux process. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2007 Red Hat, Inc. This file is part of Red Hat elfutils. Red Hat elfutils is free software; you can redistribute it and/or modify @@ -72,9 +72,8 @@ static int find_sysinfo_ehdr (pid_t pid, GElf_Addr *sysinfo_ehdr) { - char *fname = NULL; - asprintf (&fname, PROCAUXVFMT, pid); - if (fname == NULL) + char *fname; + if (asprintf (&fname, PROCAUXVFMT, pid) < 0) return ENOMEM; int fd = open64 (fname, O_RDONLY); @@ -243,9 +242,8 @@ dwfl_linux_proc_report (Dwfl *dwfl, pid_t pid) if (result != 0) return result; - char *fname = NULL; - asprintf (&fname, PROCMAPSFMT, pid); - if (fname == NULL) + char *fname; + if (asprintf (&fname, PROCMAPSFMT, pid) < 0) return ENOMEM; FILE *f = fopen (fname, "r"); @@ -312,9 +310,8 @@ dwfl_linux_proc_find_elf (Dwfl_Module *mod __attribute__ ((unused)), { /* Special case for in-memory ELF image. */ - char *fname = NULL; - asprintf (&fname, PROCMEMFMT, pid); - if (fname == NULL) + char *fname; + if (asprintf (&fname, PROCMEMFMT, pid) < 0) return -1; int fd = open64 (fname, O_RDONLY); |