CLI socket accept() may also fail and should produce some message, not a coredump.
This commit is contained in:
parent
d322ee3d54
commit
3a31c3aad6
1 changed files with 9 additions and 0 deletions
|
@ -479,6 +479,14 @@ cli_err(sock *s, int err)
|
||||||
cli_free(s->data);
|
cli_free(s->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cli_connect_err(sock *s UNUSED, int err)
|
||||||
|
{
|
||||||
|
ASSERT_DIE(err);
|
||||||
|
if (config->cli_debug)
|
||||||
|
log(L_INFO "Failed to accept CLI connection: %s", strerror(err));
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cli_connect(sock *s, uint size UNUSED)
|
cli_connect(sock *s, uint size UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -507,6 +515,7 @@ cli_init_unix(uid_t use_uid, gid_t use_gid)
|
||||||
s = cli_sk = sk_new(cli_pool);
|
s = cli_sk = sk_new(cli_pool);
|
||||||
s->type = SK_UNIX_PASSIVE;
|
s->type = SK_UNIX_PASSIVE;
|
||||||
s->rx_hook = cli_connect;
|
s->rx_hook = cli_connect;
|
||||||
|
s->err_hook = cli_connect_err;
|
||||||
s->rbsize = 1024;
|
s->rbsize = 1024;
|
||||||
s->fast_rx = 1;
|
s->fast_rx = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue