From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net From: =?UTF-8?Q?Maur=C3=ADcio?= CA Date: Mon, 25 Apr 2011 03:14:07 +0000 Message-ID: References: <86wrijennb.fsf@cmarib.ramside> <20110424171741.D5865B827@mail.bitblocks.com> <20110425020029.GA29551@dinah> Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.9p1 (Linux) Subject: Re: [9fans] Different results for the same rc script when using listen1 Topicbox-Message-UUID: d468a2c8-ead6-11e9-9d60-3106f5b1d025 > It fails on my Linux machine also. It's because an rfork with RFNOWAIT > sets up a child proc that will ignore SIGCHLD. If the program that > is executed (in this case rc) calls fork or exec all SIGCHLD signals > will be ignored, see signal(7). > > Ultimately, this causes rc to set status='' for every process it forks. > That's why all those tests are returning true. Instead of assuming status='' for every process, rc seems to be just ignoring process status and keeping the $status value it already had. See this example, exactly like what I used before, but with a pattern test that set status to 'no match': #!/usr/local/plan9/bin/9 rc ~ 1 2 for (i in `{seq 1 5}){ if (test $i -eq 3) { echo $i equals 3 } if not echo $i is different from 3 } Now, instead of true for every step, we have false: $ dial 'tcp!localhost!8080' 1 is different from 3 2 is different from 3 3 is different from 3 4 is different from 3 5 is different from 3 Thanks, MaurĂ­cio