浏览代码

Merge pull request #111300 from stuartcarnie/net_unix_error_spam

Unix: Don't print an error if `bind` fails
Rémi Verschelde 1 周之前
父节点
当前提交
1043c3fd64
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4 8
      drivers/unix/net_socket_unix.cpp

+ 4 - 8
drivers/unix/net_socket_unix.cpp

@@ -429,20 +429,16 @@ Error NetSocketUnix::bind(NetSocket::Address p_addr) {
 	ERR_FAIL_COND_V(_family != p_addr.get_family(), ERR_INVALID_PARAMETER);
 	switch (p_addr.get_family()) {
 		case Family::INET: {
-			Error res = _inet_bind(p_addr.ip(), p_addr.port());
-			ERR_FAIL_COND_V(res != OK, res);
-		} break;
+			return _inet_bind(p_addr.ip(), p_addr.port());
+		}
 		case Family::UNIX: {
 			_unix_path = p_addr.get_path();
-			Error res = _unix_bind(_unix_path);
-			ERR_FAIL_COND_V(res != OK, res);
-		} break;
+			return _unix_bind(_unix_path);
+		}
 		case Family::NONE:
 		default:
 			return ERR_INVALID_PARAMETER;
 	}
-
-	return OK;
 }
 
 Error NetSocketUnix::listen(int p_max_pending) {