template <typename, typename, typename> friend class event_dispatch;
template <typename, typename> friend class dasynq::event_loop;
+ base_bidi_fd_watcher(const base_bidi_fd_watcher &) = delete;
+
protected:
+ base_bidi_fd_watcher() noexcept { }
// The main instance is the "input" watcher only; we keep a secondary watcher with a secondary set
// of flags for the "output" watcher. Note that some of the flags in the secondary watcher aren't
{
time_val diff;
diff.seconds() = t1.seconds() - t2.seconds();
- if (t1.nseconds() > t2.nseconds()) {
+ if (t1.nseconds() >= t2.nseconds()) {
diff.nseconds() = t1.nseconds() - t2.nseconds();
}
else {
if (child == 0) {
// I am the child
+ close(pipefds[1]);
// Wait for message from parent before continuing:
int rr;
int r = read(pipefds[0], &rr, sizeof(rr));
while (r == -1 && errno == EINTR) {
- read(pipefds[0], &rr, sizeof(rr));
+ r = read(pipefds[0], &rr, sizeof(rr));
}
- if (r == -1) _exit(0);
+ if (r <= 0) _exit(0);
close(pipefds[0]);
return 0;