Demos like deferred-shading.example sometimes fail to launch due to
libdeferred-shading.example.so doesn't have main()
When such error happens, output error to logcat
Change-Id: Iecec465cf2436ff04a78ac78bd4c6fee0282ac3d
dlerror(); /* Clear any existing error */
int (*main)(int, char**) = (int (*)(int, char**))dlsym(handle, "main");
+ LOGV("lib=%s handle=%p main=%p", libpath.c_str(), handle, main );
if(main)
{
status = main(0, nullptr);
}
+ else
+ {
+ LOGE("lib %s doesn't have main()", libpath.c_str());
+ status = EFAULT;
+ std::exit(status);
+ }
if(handle)
{