mirror of
				https://github.com/tiagovignatti/intel-gpu-tools.git
				synced 2025-11-04 12:07:12 +00:00 
			
		
		
		
	lib: fix exit handler when multiple handlers are registered
Signed-off-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
		
							parent
							
								
									0e8931925d
								
							
						
					
					
						commit
						4dec89aef7
					
				@ -1065,7 +1065,7 @@ static void call_exit_handlers(int sig)
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < exit_handler_count; i++)
 | 
			
		||||
	for (i = exit_handler_count - 1; i >= 0; i--)
 | 
			
		||||
		exit_handler_fn[i](sig);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1111,6 +1111,9 @@ static int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
 | 
			
		||||
	exit_handler_fn[exit_handler_count] = fn;
 | 
			
		||||
	exit_handler_count++;
 | 
			
		||||
 | 
			
		||||
	if (exit_handler_count > 1)
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < ARRAY_SIZE(handled_signals); i++) {
 | 
			
		||||
		if (install_sig_handler(handled_signals[i],
 | 
			
		||||
					drmtest_sig_handler))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user