=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/usr.bin/tmux/server.c 2009/07/20 14:37:51 1.12 +++ src/usr.bin/tmux/server.c 2009/07/21 19:54:22 1.13 @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.12 2009/07/20 14:37:51 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.13 2009/07/21 19:54:22 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -44,6 +44,7 @@ /* Client list. */ struct clients clients; +void server_create_client(int); int server_create_socket(void); int server_main(int); void server_shutdown(void); @@ -52,7 +53,7 @@ void server_handle_windows(struct pollfd **); void server_fill_clients(struct pollfd **); void server_handle_clients(struct pollfd **); -struct client *server_accept_client(int); +void server_accept_client(int); void server_handle_client(struct client *); void server_handle_window(struct window *, struct window_pane *); int server_check_window_bell(struct session *, struct window *); @@ -69,7 +70,7 @@ int server_update_socket(void); /* Create a new client. */ -struct client * +void server_create_client(int fd) { struct client *c; @@ -107,11 +108,10 @@ for (i = 0; i < ARRAY_LENGTH(&clients); i++) { if (ARRAY_ITEM(&clients, i) == NULL) { ARRAY_SET(&clients, i, c); - return (c); + return; } } ARRAY_ADD(&clients, c); - return (c); } /* Find client index. */ @@ -735,7 +735,7 @@ } /* accept(2) and create new client. */ -struct client * +void server_accept_client(int srv_fd) { struct sockaddr_storage sa; @@ -745,14 +745,14 @@ fd = accept(srv_fd, (struct sockaddr *) &sa, &slen); if (fd == -1) { if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED) - return (NULL); + return; fatal("accept failed"); } if (sigterm) { close(fd); - return (NULL); + return; } - return (server_create_client(fd)); + server_create_client(fd); } /* Input data from client. */