Skip to content

Commit

Permalink
Make Process.new(pid) be private. Fixes #4197
Browse files Browse the repository at this point in the history
  • Loading branch information
Ary Borenszweig committed Mar 30, 2017
1 parent 0b3f7e5 commit cae9a20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/process.cr
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ class Process
pid = fork_internal do
with self yield self
end
Process.new pid
new pid
end

# Duplicates the current process.
# Returns a `Process` representing the new child process in the current process
# and `nil` inside the new child process.
def self.fork : self?
if pid = fork_internal
Process.new pid
new pid
else
nil
end
Expand Down Expand Up @@ -255,7 +255,7 @@ class Process
fork_error.try &.close
end

protected def initialize(@pid)
private def initialize(@pid)
@waitpid_future = Event::SignalChildHandler.instance.waitpid(pid)
@wait_count = 0
end
Expand Down

0 comments on commit cae9a20

Please sign in to comment.