Replace the various identical error callbacks with a single one in cmd-queue.c.

This commit is contained in:
nicm
2019-05-20 11:46:06 +00:00
parent 8db89f8efb
commit e128c7fcd8
8 changed files with 47 additions and 89 deletions

View File

@ -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;
}