main_notify: use init_async_pipe()
Remove duplicated code.
This commit is contained in:
@@ -60,14 +60,7 @@ static int ioops_consume(int fd_count, fd_set * rfds,
|
|||||||
|
|
||||||
void init_main_notify(void)
|
void init_main_notify(void)
|
||||||
{
|
{
|
||||||
if (pipe(main_pipe) < 0)
|
init_async_pipe(main_pipe);
|
||||||
FATAL("Couldn't open pipe: %s", strerror(errno));
|
|
||||||
if (set_nonblocking(main_pipe[0]) < 0)
|
|
||||||
FATAL("Couldn't set non-blocking on main_notify fd: %s",
|
|
||||||
strerror(errno));
|
|
||||||
if (set_nonblocking(main_pipe[1]) < 0)
|
|
||||||
FATAL("Couldn't set non-blocking on main_notify fd: %s",
|
|
||||||
strerror(errno));
|
|
||||||
main_notify_IO.fdset = ioops_fdset;
|
main_notify_IO.fdset = ioops_fdset;
|
||||||
main_notify_IO.consume = ioops_consume;
|
main_notify_IO.consume = ioops_consume;
|
||||||
registerIO(&main_notify_IO);
|
registerIO(&main_notify_IO);
|
||||||
|
Reference in New Issue
Block a user