This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Remove do_closedir_cleanup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]