Skip to content
Snippets Groups Projects
Commit bacd3c07 authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

Reinit coeio after fork. #517

parent 3f4ca4e8
No related merge requests found
......@@ -107,6 +107,16 @@ coeio_init(void)
ev_async_start(loop(), &coeio_manager.coeio_async);
}
/**
* ReInit coeio subsystem (for example after 'fork')
*
*/
void
coeio_reinit(void)
{
eio_init(coeio_want_poll_cb, NULL);
}
/**
* A single task context.
*/
......
......@@ -57,6 +57,7 @@ extern "C" {
*/
void coeio_init(void);
void coeio_reinit(void);
ssize_t coeio_custom(ssize_t (*f)(va_list ap), ev_tstamp timeout, ...);
struct addrinfo *
......
......@@ -367,6 +367,8 @@ background()
if (setsid() == -1)
goto error;
/* reinit coeio after fork (because libeio required it) */
coeio_reinit();
/*
* Prints to stdout on failure, so got to be done before
* we close it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment