Merge branch 'nginx' of ssh://git.karchnu.fr:2202/WeirdOS/service into nginx
commit
106e7612e9
|
@ -15,6 +15,19 @@ def split_command(string)
|
||||||
return command, args
|
return command, args
|
||||||
end
|
end
|
||||||
|
|
||||||
|
lib C
|
||||||
|
fun waitpid(pid : Int32, status_ptr : Int32*, options : Int32) : Int32
|
||||||
|
end
|
||||||
|
|
||||||
|
class Process
|
||||||
|
def self.waitpid(pid)
|
||||||
|
options = 0
|
||||||
|
status_ptr = uninitialized Int32
|
||||||
|
|
||||||
|
C.waitpid(pid, pointerof(status_ptr), options)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
class Service
|
class Service
|
||||||
getter environment : Environment
|
getter environment : Environment
|
||||||
getter providers = ProvidersList.new
|
getter providers = ProvidersList.new
|
||||||
|
@ -295,6 +308,8 @@ class Service
|
||||||
else
|
else
|
||||||
Process.kill Signal::TERM, _pid
|
Process.kill Signal::TERM, _pid
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Process.waitpid _pid
|
||||||
else
|
else
|
||||||
# Already stopped or dead, nothing to be done here.
|
# Already stopped or dead, nothing to be done here.
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue