mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: tools: spa-inspect: Output more detailed dlopen and dlsym errors
When writing a custom SPA plugin, it is very useful to get more detailed errors related to libdl. One common error is that a symbol is not present because a related library was not properly linked into the plugin. With this change, the error will tell the user about the exact missing symbol.
This commit is contained in:
		
							parent
							
								
									d9b742cfda
								
							
						
					
					
						commit
						2fe77c47e1
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -277,11 +277,11 @@ int main(int argc, char *argv[])
 | 
			
		|||
	data.n_support = 3;
 | 
			
		||||
 | 
			
		||||
	if ((handle = dlopen(argv[1], RTLD_NOW)) == NULL) {
 | 
			
		||||
		printf("can't load %s\n", argv[1]);
 | 
			
		||||
		printf("can't load %s: %s\n", argv[1], dlerror());
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
	if ((enum_func = dlsym(handle, SPA_HANDLE_FACTORY_ENUM_FUNC_NAME)) == NULL) {
 | 
			
		||||
		printf("can't find function\n");
 | 
			
		||||
		printf("can't find \"%s\" function: %s\n", SPA_HANDLE_FACTORY_ENUM_FUNC_NAME, dlerror());
 | 
			
		||||
		return -1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue