--- rxvt-unicode/src/rxvtd.C 2007/11/11 04:08:00 1.34 +++ rxvt-unicode/src/rxvtd.C 2007/11/18 00:47:13 1.38 @@ -53,6 +53,8 @@ getfd_cb (this, &server::getfd) { this->fd = fd; + fcntl (fd, F_SETFD, FD_CLOEXEC); + fcntl (fd, F_SETFL, 0); read_ev.start (fd, ev::READ); } @@ -85,6 +87,7 @@ } fcntl (fd, F_SETFD, FD_CLOEXEC); + fcntl (fd, F_SETFL, O_NONBLOCK); sa.sun_family = AF_UNIX; strcpy (sa.sun_path, sockname); @@ -115,10 +118,7 @@ int fd2 = accept (fd, 0, 0); if (fd2 >= 0) - { - fcntl (fd2, F_SETFD, FD_CLOEXEC); - new server (fd2); - } + new server (fd2); } int server::getfd (int remote_fd) @@ -273,6 +273,8 @@ } else if (pid > 0) _exit (EXIT_SUCCESS); + + ev::ev_default_fork (); } ev::ev_loop (0);