From owner-cvs-all Wed Nov 13 14: 1:22 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8A6337B401; Wed, 13 Nov 2002 14:01:21 -0800 (PST) Received: from fump.kawo2.rwth-aachen.de (fump.kawo2.RWTH-Aachen.DE [134.130.181.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A20843E4A; Wed, 13 Nov 2002 14:01:20 -0800 (PST) (envelope-from alex@fump.kawo2.rwth-aachen.de) Received: from fump.kawo2.rwth-aachen.de (localhost [127.0.0.1]) by fump.kawo2.rwth-aachen.de (8.12.5/8.12.5) with ESMTP id gADM1ElK008693; Wed, 13 Nov 2002 23:01:14 +0100 (CET) (envelope-from alex@fump.kawo2.rwth-aachen.de) Received: (from alex@localhost) by fump.kawo2.rwth-aachen.de (8.12.5/8.12.5/Submit) id gADM1Bno008692; Wed, 13 Nov 2002 23:01:11 +0100 (CET) Date: Wed, 13 Nov 2002 23:01:10 +0100 From: Alexander Langer To: Mike Silbersack Cc: "Jacques A. Vidrine" , Nate Lawson , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/sleep sleep.c Message-ID: <20021113220110.GI94076@fump.kawo2.rwth-aachen.de> References: <20021113204941.GF29284@madman.nectar.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-PGP-at: finger alex@big.endian.de X-Verwirrung: Dieser Header dient der allgemeinen Verwirrung. User-Agent: Mutt/1.5.1i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > That's not a major problem, we can work around it with ACLs. There's the > slight downside that we'll have to require extended attributes to be > available for 5.0 / partitions, but I think it's worth the tradeoff. Well, hehe :-) That's all true, but I can't see anything about obfuscated C here. I think that of the commit at least the removing of the getopt() call was an improvement. One the one hand there are no options to sleep, and getopt() was abused to find out if the argument is valid or invalid (negative): alex@zerogravity ~ $ sleep -19 sleep: illegal option -- 1 usage: sleep seconds On the other hand, you could abuse the "--" flag for getopt, resulting in different behaviour, due to a further non-negative check in the source-code: alex@zerogravity ~ $ time sleep -- -19 sleep -- -19 0.00s user 0.00s system 0% cpu 0.001 total Anyways, I personally wouldn't have removed the call to strtol(), but it's not too bad to do some simple maths yourself :) Alex To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message