about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-01-23 08:48:34 +0000
committerEric Wong <e@80x24.org>2015-01-23 08:48:34 +0000
commitddf4460bb8233d5d8ac9015b1ef34316d9681e23 (patch)
treee37dcf1e60ffb43d2e89cf543a6c11ea4dd8cb91
parent9bf21db1e0ad815187b8c93ef985ef591a606645 (diff)
downloaddtas-ddf4460bb8233d5d8ac9015b1ef34316d9681e23.tar.gz
Users may hit Ctrl-Z to stop their editor during editing
and trigger SICHLD, do not waitpid2 indefinitely in that
case.  This prevents missed "source ed" calls for inotify
users.
-rwxr-xr-xbin/dtas-sourceedit3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/dtas-sourceedit b/bin/dtas-sourceedit
index 646058f..bf9e829 100755
--- a/bin/dtas-sourceedit
+++ b/bin/dtas-sourceedit
@@ -76,7 +76,8 @@ else
     r[0].each do |io|
       case io
       when sev
-        _, status = Process.waitpid2(pid)
+        _, status = Process.waitpid2(pid, Process::WNOHANG)
+        status or next
         status.success? or abort "#{cmd} failed: #{status.inspect}"
         do_update.call
         exit