about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-17 00:07:38 +0000
committerEric Wong <e@80x24.org>2017-03-17 00:07:48 +0000
commit29b300146dcd4499e07f8e99f3ce6d1e6c88796a (patch)
treeba7bd5ca6601262d3e4052cb902b95b30193b07f
parent3b64b24b38482ddc5a65eae3408a9eafec4b7aae (diff)
downloadsleepy_penguin-29b300146dcd4499e07f8e99f3ce6d1e6c88796a.tar.gz
Relying on the record separator ($\ or "\n") is not atomic
on multi-process or multi-threaded systems writing to the
same log file or pipe.
-rw-r--r--lib/sleepy_penguin/epoll.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sleepy_penguin/epoll.rb b/lib/sleepy_penguin/epoll.rb
index 637db8d..da1502e 100644
--- a/lib/sleepy_penguin/epoll.rb
+++ b/lib/sleepy_penguin/epoll.rb
@@ -166,7 +166,7 @@ class SleepyPenguin::Epoll
         begin
           @io.epoll_ctl(CTL_MOD, io, events)
         rescue Errno::ENOENT
-          warn "epoll event cache failed (mod -> add)"
+          warn "epoll event cache failed (mod -> add)\n"
           @io.epoll_ctl(CTL_ADD, io, events)
           @marks[fd] = io
         end
@@ -174,7 +174,7 @@ class SleepyPenguin::Epoll
         begin
           @io.epoll_ctl(CTL_ADD, io, events)
         rescue Errno::EEXIST
-          warn "epoll event cache failed (add -> mod)"
+          warn "epoll event cache failed (add -> mod)\n"
           @io.epoll_ctl(CTL_MOD, io, events)
         end
         @marks[fd] = io