Skip to content

Commit cae9a20

Browse files
author
Ary Borenszweig
committedMar 30, 2017
Make Process.new(pid) be private. Fixes #4197
1 parent 0b3f7e5 commit cae9a20

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

Diff for: ‎src/process.cr

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ class Process
8181
pid = fork_internal do
8282
with self yield self
8383
end
84-
Process.new pid
84+
new pid
8585
end
8686

8787
# Duplicates the current process.
8888
# Returns a `Process` representing the new child process in the current process
8989
# and `nil` inside the new child process.
9090
def self.fork : self?
9191
if pid = fork_internal
92-
Process.new pid
92+
new pid
9393
else
9494
nil
9595
end
@@ -255,7 +255,7 @@ class Process
255255
fork_error.try &.close
256256
end
257257

258-
protected def initialize(@pid)
258+
private def initialize(@pid)
259259
@waitpid_future = Event::SignalChildHandler.instance.waitpid(pid)
260260
@wait_count = 0
261261
end

0 commit comments

Comments
 (0)
Please sign in to comment.