mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	If bind() fails, also print ip address and not just the port number.
This commit is contained in:
		| @@ -415,11 +415,13 @@ NewListener(int af, const UINT16 Port) | ||||
|  | ||||
| 	set_v6_only(af, sock); | ||||
|  | ||||
| 	if( ! Init_Socket( sock )) return -1; | ||||
| 	if (!Init_Socket(sock)) | ||||
| 		return -1; | ||||
|  | ||||
| 	if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) { | ||||
| 		Log( LOG_CRIT, "Can't bind socket (port %d) : %s!", Port, strerror( errno )); | ||||
| 		close( sock ); | ||||
| 		Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s", | ||||
| 			ng_ipaddr_tostr(&addr), Port, strerror(errno)); | ||||
| 		close(sock); | ||||
| 		return -1; | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Florian Westphal
					Florian Westphal