We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e96864 + d803637 commit f04bd39Copy full SHA for f04bd39
1 file changed
lib/rb-fsevent/fsevent.rb
@@ -52,14 +52,23 @@ def run
52
53
def stop
54
unless @pipe.nil?
55
- Process.kill('KILL', @pipe.pid)
+ Process.kill('KILL', @pipe.pid) if process_running?(@pipe.pid)
56
@pipe.close
57
end
58
rescue IOError
59
ensure
60
@running = false
61
62
63
+ def process_running?(pid)
64
+ begin
65
+ Process.kill(0, pid)
66
+ true
67
+ rescue Errno::ESRCH
68
+ false
69
+ end
70
71
+
72
if RUBY_VERSION < '1.9'
73
def open_pipe
74
IO.popen("'#{self.class.watcher_path}' #{options_string} #{shellescaped_paths}")
0 commit comments