Skip to content

Instantly share code, notes, and snippets.

@jarib
Created June 16, 2010 21:30
Show Gist options
  • Save jarib/441298 to your computer and use it in GitHub Desktop.
Save jarib/441298 to your computer and use it in GitHub Desktop.
Index: common/src/rb/lib/selenium/webdriver/child_process.rb
===================================================================
--- common/src/rb/lib/selenium/webdriver/child_process.rb (revision 9164)
+++ common/src/rb/lib/selenium/webdriver/child_process.rb (working copy)
@@ -125,9 +125,14 @@
self
end
-
+
def wait_nonblock(timeout)
- return super if defined?(Process::WNOHANG)
+ # win32-process doesn't support passing a second argument to waitpid2
+ #
+ # See the README @ http://rubyforge.org/docman/view.php/85/707/README.html
+ if defined?(Process::WNOHANG) && Process.method(:waitpid2).arity != 1
+ return super
+ end
Timeout.timeout(timeout, Error::TimeOutError) { wait }
rescue Process::Error
# no handle, great
@@ -236,4 +241,4 @@
end # ChildProcess
end # WebDriver
-end # Selenium
\ No newline at end of file
+end # Selenium
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment