Define SOL_LOCAL if not defined already (e.g. on FreeBSD).
Some evidence that defining it to be 0 is right: * OS X headers define it to be 0. * Other code uses 0 instead of SOL_LOCAL to check for peer credentials (e.g. FreeBSD's implementation of getpeereid).
This commit is contained in:
		
							parent
							
								
									12c1776df9
								
							
						
					
					
						commit
						7888b2ba15
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -692,6 +692,10 @@ static PeerInfo getPeerInfo(int remote) | ||||||
| 
 | 
 | ||||||
| #elif defined(LOCAL_PEERCRED) | #elif defined(LOCAL_PEERCRED) | ||||||
| 
 | 
 | ||||||
|  | #if !defined(SOL_LOCAL) | ||||||
|  | #define SOL_LOCAL 0 | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|     xucred cred; |     xucred cred; | ||||||
|     socklen_t credLen = sizeof(cred); |     socklen_t credLen = sizeof(cred); | ||||||
|     if (getsockopt(remote, SOL_LOCAL, LOCAL_PEERCRED, &cred, &credLen) == -1) |     if (getsockopt(remote, SOL_LOCAL, LOCAL_PEERCRED, &cred, &credLen) == -1) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue