Commit 1bb15409 authored by Max Kellermann's avatar Max Kellermann

client: client_input_received() returns 0

Since the caller chain doesn't care about the return value (except for COMMAND_RETURN_KILL, COMMAND_RETURN_CLOSE), just return 0 if there is nothing special. This saves one local variable initialization, and one access to it. Also remove one unreachable "return 1" from client_read().
parent 48191d56
...@@ -400,7 +400,7 @@ static int client_process_line(struct client *client) ...@@ -400,7 +400,7 @@ static int client_process_line(struct client *client)
static int client_input_received(struct client *client, int bytesRead) static int client_input_received(struct client *client, int bytesRead)
{ {
int ret = 0; int ret;
char *buf_tail = &(client->buffer[client->bufferLength - 1]); char *buf_tail = &(client->buffer[client->bufferLength - 1]);
while (bytesRead > 0) { while (bytesRead > 0) {
...@@ -440,7 +440,7 @@ static int client_input_received(struct client *client, int bytesRead) ...@@ -440,7 +440,7 @@ static int client_input_received(struct client *client, int bytesRead)
} }
} }
return ret; return 0;
} }
static int client_read(struct client *client) static int client_read(struct client *client)
...@@ -457,8 +457,6 @@ static int client_read(struct client *client) ...@@ -457,8 +457,6 @@ static int client_read(struct client *client)
return COMMAND_RETURN_CLOSE; return COMMAND_RETURN_CLOSE;
} else } else
return 0; return 0;
return 1;
} }
static void client_manager_register_read_fd(fd_set * fds, int *fdmax) static void client_manager_register_read_fd(fd_set * fds, int *fdmax)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment