From: KOSAKI Motohiro Date: 2012-06-07T05:17:46+09:00 Subject: [ruby-core:45450] Re: [ruby-trunk - Feature #2715] Optimization to avoid spawning shell in Kernel#system call should check for failure conditions (6/5/12 3:55 PM), akr (Akira Tanaka) wrote: > > Issue #2715 has been updated by akr (Akira Tanaka). > > >> As akr-san described, some shells have tail invocation optimization. Thus, even if ruby doesn't have shell invocation optimization, caller can't assume that spawned process is neither child nor grand child. > > If we have shell invocation optimization (as now) and the command line is > simple, the command is spawned as a child process. > > So removing the optimization breaks a program which assumes this behavior. > > For example, IO.popen("foo bar") {|io| ... Process.kill sig, io.pid ... } > will be broken by removing the optimization. > > I feel this is incompatible enough. .... I realized IO.pid is crazy mistaken feature. It wouldn't work when using complex cmdline even if we will not remove the optimization. Sigh. (+_+