Update bundled Dasynq to 1.0.4.
authorDavin McCall <davmac@davmac.org>
Tue, 16 Jan 2018 20:34:06 +0000 (20:34 +0000)
committerDavin McCall <davmac@davmac.org>
Tue, 16 Jan 2018 20:34:06 +0000 (20:34 +0000)
src/dasynq/dasynq-basewatchers.h
src/dasynq/dasynq-timerbase.h
src/dasynq/dasynq.h

index a83af71d0e24c027ac4a2f2d13ea4db6b1e7d637..67144fba9cf64e02ddf014f493fad8c200314bed 100644 (file)
@@ -181,7 +181,10 @@ namespace dprivate {
         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
index 41b02fbfb1a63021884ab256f378d71da506145a..96cc5185fd5f5a83823284c44be52a895986dfe6 100644 (file)
@@ -59,7 +59,7 @@ inline time_val operator-(const time_val &t1, const time_val &t2) noexcept
 {
     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 {
index 7150f21013d942885d9fea2ce2128640420c5a1c..08439b8a9d22106bf18aa94da0896478ec99c500 100644 (file)
@@ -1880,15 +1880,16 @@ class child_proc_watcher : private dprivate::base_child_watcher<typename EventLo
             
             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;