Commit b8f6c6518536f6cc0df18a55358a9056664e8f70
1 parent
adb375f4
Include missing header and replace bzero by memset for portability reasons.
Showing
1 changed file
with
3 additions
and
2 deletions
src/vo/GVOHub.cpp
| @@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
| 34 | #include <csignal> // signal() function | 34 | #include <csignal> // signal() function |
| 35 | #include <unistd.h> // close() function | 35 | #include <unistd.h> // close() function |
| 36 | #include <netdb.h> // getaddrinfo() function | 36 | #include <netdb.h> // getaddrinfo() function |
| 37 | +#include <netinet/in.h> // sockaddr_in, INADDR_ANY, htons | ||
| 37 | #include <fstream> | 38 | #include <fstream> |
| 38 | #include <sys/shm.h> | 39 | #include <sys/shm.h> |
| 39 | #include <sys/socket.h> // socket(), connect() functions | 40 | #include <sys/socket.h> // socket(), connect() functions |
| @@ -340,7 +341,7 @@ void GVOHub::start_hub(void) | @@ -340,7 +341,7 @@ void GVOHub::start_hub(void) | ||
| 340 | int opt = 1; | 341 | int opt = 1; |
| 341 | 342 | ||
| 342 | // Prepare TCP/IP structure | 343 | // Prepare TCP/IP structure |
| 343 | - bzero((char *) &serv_addr, sizeof(serv_addr)); | 344 | + std::memset(&serv_addr, 0, sizeof(serv_addr)); |
| 344 | portno = 8001; | 345 | portno = 8001; |
| 345 | serv_addr.sin_family = AF_INET; | 346 | serv_addr.sin_family = AF_INET; |
| 346 | serv_addr.sin_addr.s_addr = INADDR_ANY; | 347 | serv_addr.sin_addr.s_addr = INADDR_ANY; |
| @@ -440,7 +441,7 @@ void GVOHub::handle_request(const socklen_t& sock) | @@ -440,7 +441,7 @@ void GVOHub::handle_request(const socklen_t& sock) | ||
| 440 | 441 | ||
| 441 | // Initialize buffer | 442 | // Initialize buffer |
| 442 | char buffer[8192]; | 443 | char buffer[8192]; |
| 443 | - bzero(buffer,8192); | 444 | + std::memset(&buffer, 0, 8192); |
| 444 | 445 | ||
| 445 | // Read buffer | 446 | // Read buffer |
| 446 | int n = read(sock, buffer, 8192); | 447 | int n = read(sock, buffer, 8192); |