浏览代码

Small condition merge

llorx 6 年之前
父节点
当前提交
c6b0c3e5bc
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      common.cpp

+ 4 - 6
common.cpp

@@ -978,12 +978,10 @@ int new_connected_socket2(int &fd,address_t &addr,bool bind_enabled,address_t &b
 		myexit(1);
 		myexit(1);
 	}
 	}
 
 
-	if (strlen(interface_string) > 0) {
-		if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, interface_string, strlen(interface_string)) < 0) {
-			mylog(log_fatal,"socket interface bind error\n");
-			//perror("socket bind error");
-			myexit(1);
-		}
+	if (strlen(interface_string) > 0 && setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, interface_string, strlen(interface_string)) < 0) {
+		mylog(log_fatal,"socket interface bind error\n");
+		//perror("socket bind error");
+		myexit(1);
 	}
 	}
 
 
 	setnonblocking(fd);
 	setnonblocking(fd);