From owner-freebsd-bugs Tue Apr 15 19:46:49 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA00965 for bugs-outgoing; Tue, 15 Apr 1997 19:46:49 -0700 (PDT) Received: from popeye.remuda.com (fisbin.remuda.com [205.153.153.59]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id TAA00949; Tue, 15 Apr 1997 19:46:36 -0700 (PDT) Received: from localhost (scotto@localhost) by popeye.remuda.com (8.6.12/8.6.12) with SMTP id TAA00269; Tue, 15 Apr 1997 19:44:29 -0700 Date: Tue, 15 Apr 1997 19:44:29 -0700 (PDT) From: Scott Overholser Reply-To: Scott Overholser To: Zahemszky Gabor , freebsd-bugs@freebsd.org cc: hylafax@freebsd.org Subject: Re: HylaFAX broken on 2.2.0-R? In-Reply-To: <199704111127.NAA00909@CoDe.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk thanks for the info! here are my results on a 2.2.0-R system: $ f ; echo $? 78 $ g ; echo $? 0 <-- this one is not correct as you describe $ h ; echo $? 78 $ exit if this truely be a bug, what should happen next? as i mention below, i've worked around the problem. i suppose someone should take steps to make it right. i'll gladly file a bug if someone will clue me in on the correct procedure. thanks, -scotto On Fri, 11 Apr 1997, Zahemszky Gabor wrote: > > just figured this out. runMake and some other functions "return" > > explicitly. apparently return returns it's own exit status. after > > removing the return statements from captureX(), capture(), runMake(), and > > runMakeX(), the configure script ran perfectly - and the code built too. > > > > my only question now is why didn't /bin/sh behave similarly in 2.1.x? > > Sorry, I haven't got time to read my mails. So you've found the answer, but > if it is true, it's a bug in /bin/sh. The ``return'' command has to return > the status of the previous command, if return hasn't got a parameter. So > try it: > $ sh > $ f() > return 78 > $ g() > { > f > return > } > $ h() > { > f > } > $ f ; echo $? > 78 # this is the correct answer > $ g ; echo $? > 78 # this is the correct answer > $ h ; echo $? > 78 # this is the correct answer > $ exit > > If you got anything other than three 78's, send the bug report to > freebsd-bugs(?). > > Bye, Gabor > > --- > #!/bin/ksh > trap 'rm -f /tmp/$$.$$' EXIT HUP INT QUIT TERM&&print '21N16I25C25E30, 40M30E33E25T15U!'>/tmp/$$.$$&&IFS=' ABCDEFGHIJKLMNOPQRSTUVWXYZ '&&set -A X $(