use default SIGCHLD handler
[zbatery.git] / t / sigchld.ru
blob4f3b566332059a2df1a43d151755bc320477e634
1 #\ -E none
2 use Rack::ContentLength
3 use Rack::ContentType, "text/plain"
4 run lambda { |env|
5   rv = case env["PATH_INFO"]
6   when "/backtick"
7     `printf 'hi'`
8   when "/system"
9     rv = system("true")
10     rv.to_s
11   when "/fork_ignore"
12     pid = fork {}
13     pid.class.to_s
14   when "/fork_wait"
15     _, status = Process.waitpid2(fork {})
16     status.success?.to_s
17   when "/popen"
18     io = IO.popen('echo popen')
19     io.read
20   end
21   [ 200, {}, [ rv ] ]