b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | --- a/ipc_remote.cc |
| 2 | +++ b/ipc_remote.cc |
| 3 | @@ -914,7 +914,7 @@ int RootIPCRemote::OpenFDPassSock() { |
| 4 | return -1; |
| 5 | } |
| 6 | |
| 7 | - if (bind(ipc_fd_fd, (const struct sockaddr *) &unixsock, sizeof(unixsock))) { |
| 8 | + if (::bind(ipc_fd_fd, (const struct sockaddr *) &unixsock, sizeof(unixsock))) { |
| 9 | close(ipc_fd_fd); |
| 10 | _MSG("Failed to bind socket to pass file descriptors: " + |
| 11 | string(strerror(errno)), MSGFLAG_ERROR); |
| 12 | --- a/packetsource_wext.cc |
| 13 | +++ b/packetsource_wext.cc |
| 14 | @@ -405,7 +405,7 @@ void PacketSource_Wext::OpenWpaSupplican |
| 15 | wpa_local.sun_family = AF_UNIX; |
| 16 | snprintf(wpa_local.sun_path, sizeof(wpa_local.sun_path), |
| 17 | "%s", wpa_local_path.c_str()); |
| 18 | - if (bind(wpa_sock, (struct sockaddr *) &wpa_local, sizeof(wpa_local)) < 0) { |
| 19 | + if (::bind(wpa_sock, (struct sockaddr *) &wpa_local, sizeof(wpa_local)) < 0) { |
| 20 | _MSG("Source '" + parent + "' failed to bind local socket for " |
| 21 | "wpa_supplicant, disabling scan_wpa: " + string(strerror(errno)), |
| 22 | MSGFLAG_PRINTERROR); |
| 23 | --- a/tcpclient.cc |
| 24 | +++ b/tcpclient.cc |
| 25 | @@ -75,7 +75,7 @@ int TcpClient::Connect(const char *in_re |
| 26 | local_sock.sin_addr.s_addr = htonl(INADDR_ANY); |
| 27 | local_sock.sin_port = htons(0); |
| 28 | |
| 29 | - if (bind(cli_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) { |
| 30 | + if (::bind(cli_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) { |
| 31 | snprintf(errstr, 1024, "TCP client bind() failed: %s", strerror(errno)); |
| 32 | globalreg->messagebus->InjectMessage(errstr, MSGFLAG_ERROR); |
| 33 | close(cli_fd); |
| 34 | @@ -170,7 +170,7 @@ int TcpClient::ConnectSync(const char *i |
| 35 | local_sock.sin_addr.s_addr = htonl(INADDR_ANY); |
| 36 | local_sock.sin_port = htons(0); |
| 37 | |
| 38 | - if (bind(cli_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) { |
| 39 | + if (::bind(cli_fd, (struct sockaddr *) &local_sock, sizeof(local_sock)) < 0) { |
| 40 | snprintf(errstr, 1024, "TCP client bind() failed: %s", strerror(errno)); |
| 41 | globalreg->messagebus->InjectMessage(errstr, MSGFLAG_ERROR); |
| 42 | close(cli_fd); |
| 43 | --- a/tcpserver.cc |
| 44 | +++ b/tcpserver.cc |
| 45 | @@ -84,7 +84,7 @@ int TcpServer::EnableServer() { |
| 46 | } |
| 47 | |
| 48 | // Bind the socket |
| 49 | - if (bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) { |
| 50 | + if (::bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) { |
| 51 | snprintf(errstr, STATUS_MAX, "TCP server bind() failed: %s", |
| 52 | strerror(errno)); |
| 53 | globalreg->messagebus->InjectMessage(errstr, MSGFLAG_ERROR); |
| 54 | --- a/unixdomainserver.cc |
| 55 | +++ b/unixdomainserver.cc |
| 56 | @@ -64,7 +64,7 @@ int UnixDomainServer::EnableServer() { |
| 57 | } |
| 58 | |
| 59 | // Bind the socket |
| 60 | - if (bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) { |
| 61 | + if (::bind(serv_fd, (struct sockaddr *) &serv_sock, sizeof(serv_sock)) < 0) { |
| 62 | _MSG("Unix domain server bind() failed: " + string(strerror(errno)), |
| 63 | MSGFLAG_ERROR); |
| 64 | return -1; |