This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove do_closedir_cleanup
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 4 May 2018 18:56:35 +0100
- Subject: Re: [RFA] Remove do_closedir_cleanup
- References: <20180504165009.12758-1-tom@tromey.com>
On 05/04/2018 05:50 PM, Tom Tromey wrote:
> This removes both copies of do_closedir_cleanup in favor of a new
> unique_ptr specialization.
>
> Tested by the buildbot, though I'm not sure that these code paths are
> exercised there.
They're not -- we don't have Solaris or QNX build slaves.
I noticed a typo, but otherwise it looks fine to me on a quick
glance.
> static int
> proc_update_threads (procinfo *pi)
> {
> char pathname[MAX_PROC_NAME_SIZE + 16];
> struct dirent *direntry;
> - struct cleanup *old_chain = NULL;
> procinfo *thread;
> - DIR *dirp;
> + gdb_dir_up dirp;
> int lwpid;
>
> /* We should never have to apply this operation to any procinfo
> @@ -1756,11 +1749,11 @@ proc_update_threads (procinfo *pi)
>
> strcpy (pathname, pi->pathname);
> strcat (pathname, "/lwp");
> - if ((dirp = opendir (pathname)) == NULL)
> + dir.reset (opendir (pathname));
Typo: dir -> dirp.
> + if (dirp == NULL)
> proc_error (pi, "update_threads, opendir", __LINE__);
>
Thanks,
Pedro Alves