GUAC-1361: listen() need not be present in main loop

See GUAC-1361.

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
This commit is contained in:
Isaac Boukris 2015-09-28 03:58:53 +03:00
parent 602285be35
commit 61b01299b2

View File

@ -607,17 +607,17 @@ int main(int argc, char* argv[]) {
/* Free addresses */ /* Free addresses */
freeaddrinfo(addresses); freeaddrinfo(addresses);
/* Listen for connections */
if (listen(socket_fd, 5) < 0) {
guacd_log(GUAC_LOG_ERROR, "Could not listen on socket: %s", strerror(errno));
return 3;
}
/* Daemon loop */ /* Daemon loop */
for (;;) { for (;;) {
pid_t child_pid; pid_t child_pid;
/* Listen for connections */
if (listen(socket_fd, 5) < 0) {
guacd_log(GUAC_LOG_ERROR, "Could not listen on socket: %s", strerror(errno));
return 3;
}
/* Accept connection */ /* Accept connection */
client_addr_len = sizeof(client_addr); client_addr_len = sizeof(client_addr);
connected_socket_fd = accept(socket_fd, connected_socket_fd = accept(socket_fd,