Skip to content

Commit

Permalink
Run exec properly to restart. Fixes #154
Browse files Browse the repository at this point in the history
  • Loading branch information
evanphx committed Mar 19, 2013
1 parent 86b9bf5 commit 7c6d72b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/puma/cli.rb
Expand Up @@ -115,7 +115,7 @@ def restart!
end

require 'puma/jruby_restart'
JRubyRestart.chdir_exec(@restart_dir, Gem.ruby, *@restart_argv)
JRubyRestart.chdir_exec(@restart_dir, @restart_argv)
else
redirects = {}
@binder.listeners.each_with_index do |(l,io),i|
Expand Down
8 changes: 4 additions & 4 deletions lib/puma/jruby_restart.rb
Expand Up @@ -8,12 +8,12 @@ module JRubyRestart
attach_function :execlp, [:string, :varargs], :int
attach_function :chdir, [:string], :int

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

0 comments on commit 7c6d72b

Please sign in to comment.