mirror of
				https://git.haproxy.org/git/haproxy.git/
				synced 2025-11-04 02:21:03 +01:00 
			
		
		
		
	MINOR: sock: update broken accept4 detection for older hardwares.
Some older ARM embedded settings set errno to EPERM instead of ENOSYS for missing implementations (e.g. Freescale ARM 2.6.35)
This commit is contained in:
		
							parent
							
								
									21d5f43aa6
								
							
						
					
					
						commit
						7fe8989fbb
					
				@ -88,9 +88,13 @@ struct connection *sock_accept_conn(struct listener *l, int *status)
 | 
				
			|||||||
	 * the legacy accept() + fcntl().
 | 
						 * the legacy accept() + fcntl().
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (unlikely(accept4_broken) ||
 | 
						if (unlikely(accept4_broken) ||
 | 
				
			||||||
 | 
						    /* Albeit it appears it does not make sense to carry on with accept
 | 
				
			||||||
 | 
						     * if we encounter EPERM, some old embedded ARM Linux 2.6.x sets as
 | 
				
			||||||
 | 
						     * such instead of ENOSYS.
 | 
				
			||||||
 | 
						     */
 | 
				
			||||||
	    (((cfd = accept4(l->rx.fd, (struct sockaddr*)addr, &laddr,
 | 
						    (((cfd = accept4(l->rx.fd, (struct sockaddr*)addr, &laddr,
 | 
				
			||||||
	                     SOCK_NONBLOCK | (master ? SOCK_CLOEXEC : 0))) == -1) &&
 | 
						                     SOCK_NONBLOCK | (master ? SOCK_CLOEXEC : 0))) == -1) &&
 | 
				
			||||||
	     (errno == ENOSYS || errno == EINVAL || errno == EBADF) &&
 | 
						     (errno == ENOSYS || errno == EINVAL || errno == EBADF || errno == EPERM) &&
 | 
				
			||||||
	     ((accept4_broken = 1))))
 | 
						     ((accept4_broken = 1))))
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user