prefork_main_fn_t *main_fn, void *private_data,
struct prefork_pool **pf_pool)
{
- struct prefork_pool *pfp;
+ struct prefork_pool *pfp = NULL;
pid_t pid;
time_t now = time(NULL);
size_t data_size;
*/
int prefork_expand_pool(struct prefork_pool *pfp, int new_max)
{
- struct prefork_pool *pool;
+ struct prefork_pool *pool = NULL;
size_t old_size;
size_t new_size;
int ret;
{
const DATA_BLOB ping = data_blob_null;
time_t now = time(NULL);
- struct prefork_oldest *oldest;
+ struct prefork_oldest *oldest = NULL;
int i, j;
oldest = talloc_array(pfp, struct prefork_oldest, pfp->pool_size);
int signum, int count,
void *siginfo, void *pvt)
{
- struct prefork_pool *pfp;
-
- pfp = talloc_get_type_abort(pvt, struct prefork_pool);
+ struct prefork_pool *pfp = talloc_get_type_abort(
+ pvt, struct prefork_pool);
/* run the cleanup function to make sure all dead children are
* properly and timely retired. */
static bool prefork_setup_sigchld_handler(struct tevent_context *ev_ctx,
struct prefork_pool *pfp)
{
- struct tevent_signal *se;
+ struct tevent_signal *se = NULL;
se = tevent_add_signal(ev_ctx, pfp, SIGCHLD, 0,
prefork_sigchld_handler, pfp);
int listen_fd_size,
struct pf_listen_fd *listen_fds)
{
- struct tevent_req *req;
- struct pf_listen_state *state;
- struct pf_listen_ctx *ctx;
- struct tevent_fd *fde;
- TALLOC_CTX *fde_ctx;
+ struct tevent_req *req = NULL;
+ struct pf_listen_state *state = NULL;
+ struct pf_listen_ctx *ctx = NULL;
+ struct tevent_fd *fde = NULL;
+ TALLOC_CTX *fde_ctx = NULL;
int i;
req = tevent_req_create(mem_ctx, &state, struct pf_listen_state);
struct tevent_fd *fde,
uint16_t flags, void *pvt)
{
- struct pf_listen_state *state;
- struct tevent_req *req;
- struct pf_listen_ctx *ctx;
+ struct pf_listen_ctx *ctx = talloc_get_type_abort(
+ pvt, struct pf_listen_ctx);
+ struct tevent_req *req = ctx->req;
+ struct pf_listen_state *state = tevent_req_data(
+ ctx->req, struct pf_listen_state);
struct sockaddr_storage addr;
socklen_t addrlen;
int soerr = 0;
int sd = -1;
int ret;
- ctx = talloc_get_type_abort(pvt, struct pf_listen_ctx);
- req = ctx->req;
- state = tevent_req_data(ctx->req, struct pf_listen_state);
-
if ((state->pf->cmds == PF_SRV_MSG_EXIT) &&
(state->pf->num_clients <= 0)) {
/* We have been asked to exit, so drop here and the next
struct tsocket_address **srv_addr,
struct tsocket_address **cli_addr)
{
- struct pf_listen_state *state;
+ struct pf_listen_state *state = tevent_req_data(
+ req, struct pf_listen_state);
int ret = 0;
- state = tevent_req_data(req, struct pf_listen_state);
-
if (state->error) {
ret = state->error;
} else {