summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-05-20 11:46:07 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-05-20 11:46:07 +0000
commit6f099b77282e917b685cce147d969dce4f3a90e7 (patch)
treee8f5dd7ad3239007e0b1ad78a807def5cd425578 /usr.bin/tmux/server.c
parent1eb0e5705cde3a330f37bb66a31081a06c01af6d (diff)
Replace the various identical error callbacks with a single one in cmd-queue.c.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r--usr.bin/tmux/server.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 96d248e4d6b..9e741815ff5 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.184 2019/04/17 14:37:48 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.185 2019/05/20 11:46:06 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -144,18 +144,6 @@ fail:
return (-1);
}
-/* Server error callback. */
-static enum cmd_retval
-server_start_error(struct cmdq_item *item, void *data)
-{
- char *error = data;
-
- cmdq_error(item, "%s", error);
- free(error);
-
- return (CMD_RETURN_NORMAL);
-}
-
/* Fork new server. */
int
server_start(struct tmuxproc *client, struct event_base *base, int lockfd,
@@ -217,7 +205,8 @@ server_start(struct tmuxproc *client, struct event_base *base, int lockfd,
}
if (cause != NULL) {
- cmdq_append(c, cmdq_get_callback(server_start_error, cause));
+ cmdq_append(c, cmdq_get_error(cause));
+ free(cause);
c->flags |= CLIENT_EXIT;
}