Skip to content

Commit

Permalink
crystal-lang#8642 requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-zajic committed Jan 3, 2020
1 parent 9dfa84b commit 8c705bf
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/process.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,19 @@ class Process
LibC.getppid
end

# Sends a *signal* to the processes identified by the given *pids*.
@[Deprecated("Use #signal instead")]
def self.kill(signal : Signal, *pids : Int)
pids.each do |pid|
ret = LibC.kill(pid, signal.value)
raise Errno.new("kill") if ret < 0
signal signal, pid
end
nil
end

# Sends a *signal* to the processes identified by the given *pids*.
def self.signal(signal : Signal, *pids : Int)
pids.each do |pid|
ret = LibC.kill(pid, signal.value)
raise Errno.new("kill") if ret < 0
end
# Sends a *signal* to the process identified by the given *pid*.
def self.signal(signal : Signal, pid : Int)
ret = LibC.kill(pid, signal.value)
raise Errno.new("kill") if ret < 0
nil
end

Expand Down Expand Up @@ -358,14 +356,15 @@ class Process
@wait_count = 0
end

# See also: `Process.kill`
@[Deprecated("Use #signal instead")]
def kill(sig = Signal::TERM)
signal sig
end

# See also: `Process.signal`
def signal(sig)
Process.signal sig, @pid
# Sends *signal* to the process.
def signal(signal : Signal)
Process.signal signal, @pid
end

# Waits for this process to complete and closes any pipes.
Expand Down

0 comments on commit 8c705bf

Please sign in to comment.