Report better error from server when socket create fails, GitHub issue

1201.
This commit is contained in:
nicm
2017-12-19 15:00:39 +00:00
parent 62144b9f57
commit b20a00f93e
4 changed files with 49 additions and 16 deletions

View File

@ -161,7 +161,7 @@ server_client_is_default_key_table(struct client *c, struct key_table *table)
}
/* Create a new client. */
void
struct client *
server_client_create(int fd)
{
struct client *c;
@ -214,6 +214,7 @@ server_client_create(int fd)
TAILQ_INSERT_TAIL(&clients, c, entry);
log_debug("new client %p", c);
return (c);
}
/* Open client terminal if needed. */
@ -1550,6 +1551,9 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
int argc;
char **argv, *cause;
if (c->flags & CLIENT_EXIT)
return;
if (imsg->hdr.len - IMSG_HEADER_SIZE < sizeof data)
fatalx("bad MSG_COMMAND size");
memcpy(&data, imsg->data, sizeof data);