mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
(main): Correct tests for failing dlopen.
This commit is contained in:
@@ -71,6 +71,7 @@ main (void)
|
|||||||
|
|
||||||
printf ("\nThis is what is in memory now:\n");
|
printf ("\nThis is what is in memory now:\n");
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf( "Loading shared object neededobj3.so\n");
|
printf( "Loading shared object neededobj3.so\n");
|
||||||
obj3 = dlopen( "neededobj3.so", RTLD_LAZY);
|
obj3 = dlopen( "neededobj3.so", RTLD_LAZY);
|
||||||
if (obj3 == NULL)
|
if (obj3 == NULL)
|
||||||
@@ -78,41 +79,44 @@ main (void)
|
|||||||
printf ("%s\n", dlerror ());
|
printf ("%s\n", dlerror ());
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
printf ("And this is what is now in memory\n");
|
|
||||||
loaded[0] = "neededobj1.so";
|
loaded[0] = "neededobj1.so";
|
||||||
loaded[1] = "neededobj2.so";
|
loaded[1] = "neededobj2.so";
|
||||||
loaded[2] = "neededobj3.so";
|
loaded[2] = "neededobj3.so";
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf ("Now loading shared object neededobj2.so\n");
|
printf ("Now loading shared object neededobj2.so\n");
|
||||||
obj2[0] = dlopen ("neededobj2.so", RTLD_LAZY);
|
obj2[0] = dlopen ("neededobj2.so", RTLD_LAZY);
|
||||||
if (obj2 == NULL)
|
if (obj2[0] == NULL)
|
||||||
{
|
{
|
||||||
printf ("%s\n", dlerror ());
|
printf ("%s\n", dlerror ());
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
printf ("After loading neededobj2.so once\n");
|
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf ("And loading shared object neededobj2.so again\n");
|
printf ("And loading shared object neededobj2.so again\n");
|
||||||
obj2[1] = dlopen ("neededobj2.so", RTLD_LAZY);
|
obj2[1] = dlopen ("neededobj2.so", RTLD_LAZY);
|
||||||
if (obj2 == NULL)
|
if (obj2[1] == NULL)
|
||||||
{
|
{
|
||||||
printf ("%s\n", dlerror ());
|
printf ("%s\n", dlerror ());
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
printf ("Again, this is what is in memory\n");
|
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf ("Closing neededobj2.so for the first time\n");
|
printf ("Closing neededobj2.so for the first time\n");
|
||||||
dlclose (obj2[0]);
|
dlclose (obj2[0]);
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf ("Closing neededobj3.so\n");
|
printf ("Closing neededobj3.so\n");
|
||||||
dlclose (obj3);
|
dlclose (obj3);
|
||||||
loaded[2] = NULL;
|
loaded[2] = NULL;
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
printf ("Closing neededobj2.so for the second time\n");
|
printf ("Closing neededobj2.so for the second time\n");
|
||||||
dlclose (obj2[1]);
|
dlclose (obj2[1]);
|
||||||
loaded[0] = NULL;
|
loaded[0] = NULL;
|
||||||
loaded[1] = NULL;
|
loaded[1] = NULL;
|
||||||
errors += check_loaded_objects (loaded);
|
errors += check_loaded_objects (loaded);
|
||||||
|
|
||||||
if (errors != 0)
|
if (errors != 0)
|
||||||
printf ("%d errors found\n", errors);
|
printf ("%d errors found\n", errors);
|
||||||
return errors;
|
return errors;
|
||||||
|
Reference in New Issue
Block a user