mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	shm: provide actual error on mmap failed
When an mmap() fails, a WL_SHM_ERROR_INVALID_FD is raised and the client is killed. However, there is no indication of the actual system error that caused mmap() to fail, which makes such error harder to investigate. Provide the actual error message that caused mmap() to fail. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
		
							parent
							
								
									bf7cc68053
								
							
						
					
					
						commit
						0fa3474be3
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -281,7 +281,7 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
 | 
			
		|||
	if (pool->data == MAP_FAILED) {
 | 
			
		||||
		wl_resource_post_error(resource,
 | 
			
		||||
				       WL_SHM_ERROR_INVALID_FD,
 | 
			
		||||
				       "failed mmap fd %d", fd);
 | 
			
		||||
				       "failed mmap fd %d: %m", fd);
 | 
			
		||||
		goto err_free;
 | 
			
		||||
	}
 | 
			
		||||
	close(fd);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue