mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	client: Simply wl_display_dispatch_queue_pending() and fix return value
We're supposed to return number of events dispatched on success, not 0. Refactor to avoid goto and just return ret.
This commit is contained in:
		
							parent
							
								
									03dc786c90
								
							
						
					
					
						commit
						c1fd097cd9
					
				
					 1 changed files with 4 additions and 7 deletions
				
			
		| 
						 | 
					@ -1157,18 +1157,15 @@ WL_EXPORT int
 | 
				
			||||||
wl_display_dispatch_queue_pending(struct wl_display *display,
 | 
					wl_display_dispatch_queue_pending(struct wl_display *display,
 | 
				
			||||||
				  struct wl_event_queue *queue)
 | 
									  struct wl_event_queue *queue)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						int ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pthread_mutex_lock(&display->mutex);
 | 
						pthread_mutex_lock(&display->mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (dispatch_queue(display, queue) == -1)
 | 
						ret = dispatch_queue(display, queue);
 | 
				
			||||||
		goto err_unlock;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pthread_mutex_unlock(&display->mutex);
 | 
						pthread_mutex_unlock(&display->mutex);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return ret;
 | 
				
			||||||
 | 
					 | 
				
			||||||
 err_unlock:
 | 
					 | 
				
			||||||
	pthread_mutex_unlock(&display->mutex);
 | 
					 | 
				
			||||||
	return -1;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/** Process incoming events
 | 
					/** Process incoming events
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue