Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close file stream when reading pid from pidfile #2048

Merged
merged 2 commits into from Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Expand Up @@ -7,6 +7,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