Skip to content

Commit

Permalink
Close file stream when reading pid from pidfile (#2048)
Browse files Browse the repository at this point in the history
* close file stream when reading pid from pidfile

* add changelog
  • Loading branch information
hahmed authored and nateberkopec committed Oct 21, 2019
1 parent c379424 commit 14782fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -8,6 +8,7 @@
* Bugfixes
* Fix Errno::EINVAL when SSL is enabled and browser rejects cert (#1564)
* Fix pumactl defaulting puma to development if an environment was not specified (#2035)
* Fix closing file stream when reading pid from pidfile (#2048)

## 4.2.1 / 2019-10-07

Expand Down
2 changes: 1 addition & 1 deletion lib/puma/control_cli.rb
Expand Up @@ -132,7 +132,7 @@ def prepare_configuration
@pid = sf.pid
elsif @pidfile
# get pid from pid_file
@pid = File.open(@pidfile).gets.to_i
File.open(@pidfile) { |f| @pid = f.read.to_i }
end
end

Expand Down

0 comments on commit 14782fd

Please sign in to comment.