[patch] Fix dlclose / exit running in parallel resulting in dtor being called twice
Florian Weimer
fweimer@redhat.com
Wed Feb 6 09:37:00 GMT 2019
* Paul Pluzhnikov:
> +void *
> +open_library (const char * pathname)
> +{
> + void *dso;
> + char *err;
> +
> + /* Open the DSO. */
> + dso = dlopen (pathname, RTLD_NOW|RTLD_GLOBAL);
> + if (dso == NULL)
> + {
> + err = dlerror ();
> + fprintf (stderr, "%s\n", err);
> + exit (1);
> + }
> + /* Clear any errors. */
> + dlerror ();
> + return dso;
> +}
Why did you add the dlerror call in the success case?
Thanks,
Florian
More information about the Libc-alpha
mailing list