Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jan 2003 14:28:33 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        current@FreeBSD.ORG
Cc:        fanf@FreeBSD.ORG
Subject:   Re: alpha tinderbox failure
Message-ID:  <20030105132833.GA283@crow.dom2ip.de>
In-Reply-To: <20030105093314.GA10725@dragon.nuxi.com>
References:  <2994.1041712055@critter.freebsd.dk> <20030105175202.N14167-100000@gamplex.bde.org> <20030105093314.GA10725@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2003/01/05 at 01:33:14 -0800, David O'Brien wrote:
> On Sun, Jan 05, 2003 at 06:00:26PM +1100, Bruce Evans wrote:
> > > >> ===> usr.bin/vi
> > > >> *** Error code 1 (ignored)
> > > >> *** Error code 1 (ignored)
> > > >> ===> usr.bin/vis
> ..
> > No; it would be more profitable to teach programmers to not ignore errors.
> > whereintheworld is perfectly non-broken in not ignoring them.  These
> > "*** Error" messages (not to mention other error ouput from makeworld)
> > also make it harder for human readers to see the actual errors.
> 
> Agreed.  I'd love to hear from fanf what the changes are to unifdef that
> causes this change in exit code.

According to the man page, this is the correct behaviour:

  The unifdef utility exits 0 if the output is an exact copy of the input,
  1 if not, and 2 if in trouble.

The exit status code in unifdef seems to have been broken before for a
while.

The vi Makefile just was sloppy in checking for the exit code; it
should probably check for 1 and exclude 0 also, like:

--- Makefile	29 Jul 2002 09:40:16 -0000	1.38
+++ Makefile	5 Jan 2003 13:20:49 -0000
@@ -75,10 +75,12 @@
 
 # unifdef has some *weird* exit codes, sigh!  RTFM unifdef(1)...
 ex_notcl.c: ex_tcl.c
-	-unifdef -UHAVE_TCL_INTERP ${SRCDIR}/ex/ex_tcl.c > ${.TARGET}
+	! { unifdef -UHAVE_TCL_INTERP ${SRCDIR}/ex/ex_tcl.c > ${.TARGET} || \
+	[ $$? -ne 1 ] ; }
 
 ex_noperl.c: ex_perl.c
-	-unifdef -UHAVE_PERL_INTERP ${SRCDIR}/ex/ex_perl.c > ${.TARGET}
+	! { unifdef -UHAVE_PERL_INTERP ${SRCDIR}/ex/ex_perl.c > ${.TARGET} || \
+	[ $$? -ne 1 ] ; }
 
 CLEANFILES+=	ex_notcl.c ex_noperl.c
 
---

(there's probably a more elegant way to do this, my sh is a bit
rusty).

	- Thomas

-- 
Thomas Moestl <tmoestl@gmx.net>	http://www.tu-bs.de/~y0015675/
              <tmm@FreeBSD.org>	http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030105132833.GA283>