aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-23 23:47:23 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-23 23:47:23 +0000
commit7cd412dc57db8d116825764e2c06cd913edd3d7b (patch)
tree4a887c3e0ce065d2111add144e8da2b4d5fccc8f
parent1870b96578cdc7d6605ce1d08bf2023f54b22935 (diff)
downloadrtmux-7cd412dc57db8d116825764e2c06cd913edd3d7b.tar.gz
rtmux-7cd412dc57db8d116825764e2c06cd913edd3d7b.tar.bz2
rtmux-7cd412dc57db8d116825764e2c06cd913edd3d7b.zip
Sync OpenBSD patchset 173:
None of the server message functions return anything but 0, so make them all void. Also remove a leftover variable in client.c.
-rw-r--r--client.c4
-rw-r--r--server-msg.c47
2 files changed, 18 insertions, 33 deletions
diff --git a/client.c b/client.c
index 65545c6b..34aad32d 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.55 2009-07-23 23:42:59 tcunha Exp $ */
+/* $Id: client.c,v 1.56 2009-07-23 23:47:23 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -138,14 +138,12 @@ int
client_main(struct client_ctx *cctx)
{
struct pollfd pfd;
- char *error;
int xtimeout; /* Yay for ncurses namespace! */
siginit();
logfile("client");
- error = NULL;
while (!sigterm) {
if (sigchld) {
waitpid(WAIT_ANY, NULL, WNOHANG);
diff --git a/server-msg.c b/server-msg.c
index cee2ec68..1b6ab215 100644
--- a/server-msg.c
+++ b/server-msg.c
@@ -1,4 +1,4 @@
-/* $Id: server-msg.c,v 1.72 2009-07-08 18:03:03 nicm Exp $ */
+/* $Id: server-msg.c,v 1.73 2009-07-23 23:47:23 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -26,12 +26,12 @@
#include "tmux.h"
-int server_msg_fn_command(struct hdr *, struct client *);
-int server_msg_fn_identify(struct hdr *, struct client *);
-int server_msg_fn_resize(struct hdr *, struct client *);
-int server_msg_fn_exiting(struct hdr *, struct client *);
-int server_msg_fn_unlock(struct hdr *, struct client *);
-int server_msg_fn_wakeup(struct hdr *, struct client *);
+void server_msg_fn_command(struct hdr *, struct client *);
+void server_msg_fn_identify(struct hdr *, struct client *);
+void server_msg_fn_resize(struct hdr *, struct client *);
+void server_msg_fn_exiting(struct hdr *, struct client *);
+void server_msg_fn_unlock(struct hdr *, struct client *);
+void server_msg_fn_wakeup(struct hdr *, struct client *);
void printflike2 server_msg_fn_command_error(
struct cmd_ctx *, const char *, ...);
@@ -42,7 +42,7 @@ void printflike2 server_msg_fn_command_info(
struct server_msg {
enum hdrtype type;
- int (*fn)(struct hdr *, struct client *);
+ void (*fn)(struct hdr *, struct client *);
};
const struct server_msg server_msg_table[] = {
{ MSG_IDENTIFY, server_msg_fn_identify },
@@ -59,7 +59,6 @@ server_msg_dispatch(struct client *c)
struct hdr hdr;
const struct server_msg *msg;
u_int i;
- int n;
for (;;) {
if (BUFFER_USED(c->in) < sizeof hdr)
@@ -72,8 +71,7 @@ server_msg_dispatch(struct client *c)
for (i = 0; i < nitems(server_msg_table); i++) {
msg = server_msg_table + i;
if (msg->type == hdr.type) {
- if ((n = msg->fn(&hdr, c)) != 0)
- return (n);
+ msg->fn(&hdr, c);
break;
}
}
@@ -127,7 +125,7 @@ server_msg_fn_command_info(struct cmd_ctx *ctx, const char *fmt, ...)
xfree(msg);
}
-int
+void
server_msg_fn_command(struct hdr *hdr, struct client *c)
{
struct msg_command_data data;
@@ -160,7 +158,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c)
"unset $TMUX to force");
cmd_list_free(cmdlist);
server_write_client(c, MSG_EXIT, NULL, 0);
- return (0);
+ return;
}
}
}
@@ -168,10 +166,9 @@ server_msg_fn_command(struct hdr *hdr, struct client *c)
if (cmd_list_exec(cmdlist, &ctx) != 1)
server_write_client(c, MSG_EXIT, NULL, 0);
cmd_list_free(cmdlist);
- return (0);
}
-int
+void
server_msg_fn_identify(struct hdr *hdr, struct client *c)
{
struct msg_identify_data data;
@@ -190,7 +187,7 @@ server_msg_fn_identify(struct hdr *hdr, struct client *c)
server_write_client(c, MSG_ERROR, MSG, (sizeof MSG) - 1);
#undef MSG
server_write_client(c, MSG_EXIT, NULL, 0);
- return (0);
+ return;
}
c->tty.sx = data.sx;
@@ -216,11 +213,9 @@ server_msg_fn_identify(struct hdr *hdr, struct client *c)
xfree(term);
c->flags |= CLIENT_TERMINAL;
-
- return (0);
}
-int
+void
server_msg_fn_resize(struct hdr *hdr, struct client *c)
{
struct msg_resize_data data;
@@ -247,11 +242,9 @@ server_msg_fn_resize(struct hdr *hdr, struct client *c)
/* Always redraw this client. */
server_redraw_client(c);
-
- return (0);
}
-int
+void
server_msg_fn_exiting(struct hdr *hdr, struct client *c)
{
if (hdr->size != 0)
@@ -264,11 +257,9 @@ server_msg_fn_exiting(struct hdr *hdr, struct client *c)
tty_close(&c->tty, c->flags & CLIENT_SUSPENDED);
server_write_client(c, MSG_EXITED, NULL, 0);
-
- return (0);
}
-int
+void
server_msg_fn_unlock(struct hdr *hdr, struct client *c)
{
char *pass;
@@ -289,11 +280,9 @@ server_msg_fn_unlock(struct hdr *hdr, struct client *c)
memset(pass, 0, strlen(pass));
xfree(pass);
-
- return (0);
}
-int
+void
server_msg_fn_wakeup(struct hdr *hdr, struct client *c)
{
if (hdr->size != 0)
@@ -304,6 +293,4 @@ server_msg_fn_wakeup(struct hdr *hdr, struct client *c)
c->flags &= ~CLIENT_SUSPENDED;
tty_start_tty(&c->tty);
server_redraw_client(c);
-
- return (0);
}