main_notify: use init_async_pipe()

Remove duplicated code.
This commit is contained in:
Max Kellermann 2008-09-23 20:47:31 +02:00
parent 913028a780
commit 1db88364bb
1 changed files with 1 additions and 8 deletions

View File

@ -60,14 +60,7 @@ static int ioops_consume(int fd_count, fd_set * rfds,
void init_main_notify(void)
{
if (pipe(main_pipe) < 0)
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));
init_async_pipe(main_pipe);
main_notify_IO.fdset = ioops_fdset;
main_notify_IO.consume = ioops_consume;
registerIO(&main_notify_IO);