Sha256: 0026ec4d9efe3a081a153a974c69800c7eef1a6d7293ffc2e1db06bf0210d7ba

Contents?: true

Size: 447 Bytes

Versions: 8

Compression:

Stored size: 447 Bytes

Contents

require 'ffi'

module Puma
  module JRubyRestart
    extend FFI::Library
    ffi_lib 'c'

    attach_function :execlp, [:string, :varargs], :int
    attach_function :chdir, [:string], :int

    def self.chdir_exec(dir, argv)
      chdir(dir)
      cmd = argv.first
      argv = ([:string] * argv.size).zip(argv).flatten
      argv << :string
      argv << nil
      execlp(cmd, *argv)
      raise SystemCallError.new(FFI.errno)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puma-2.1.0-java lib/puma/jruby_restart.rb
puma-2.1.0 lib/puma/jruby_restart.rb
puma-2.0.1-java lib/puma/jruby_restart.rb
puma-2.0.1 lib/puma/jruby_restart.rb
puma-2.0.0-java lib/puma/jruby_restart.rb
puma-2.0.0 lib/puma/jruby_restart.rb
puma-2.0.0.b7-java lib/puma/jruby_restart.rb
puma-2.0.0.b7 lib/puma/jruby_restart.rb