mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-17 00:51:36 +02:00
Sync OpenBSD patchset 155:
Make some functions which return unused values void (mostly found by lint) and tweak a redundant expression in window_pane_set_mode.
This commit is contained in:
18
server.c
18
server.c
@ -1,4 +1,4 @@
|
||||
/* $Id: server.c,v 1.161 2009-07-20 16:07:23 tcunha Exp $ */
|
||||
/* $Id: server.c,v 1.162 2009-07-22 17:46:53 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -43,6 +43,7 @@
|
||||
/* Client list. */
|
||||
struct clients clients;
|
||||
|
||||
void server_create_client(int);
|
||||
int server_create_socket(void);
|
||||
int server_main(int);
|
||||
void server_shutdown(void);
|
||||
@ -51,7 +52,7 @@ void server_fill_windows(struct pollfd **);
|
||||
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 *);
|
||||
@ -68,7 +69,7 @@ void server_second_timers(void);
|
||||
int server_update_socket(void);
|
||||
|
||||
/* Create a new client. */
|
||||
struct client *
|
||||
void
|
||||
server_create_client(int fd)
|
||||
{
|
||||
struct client *c;
|
||||
@ -106,11 +107,10 @@ server_create_client(int fd)
|
||||
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. */
|
||||
@ -740,7 +740,7 @@ server_handle_clients(struct pollfd **pfd)
|
||||
}
|
||||
|
||||
/* accept(2) and create new client. */
|
||||
struct client *
|
||||
void
|
||||
server_accept_client(int srv_fd)
|
||||
{
|
||||
struct sockaddr_storage sa;
|
||||
@ -750,14 +750,14 @@ server_accept_client(int srv_fd)
|
||||
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. */
|
||||
|
Reference in New Issue
Block a user