From owner-cvs-all Tue Feb 4 4:40:42 2003 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 2E1AE37B401; Tue, 4 Feb 2003 04:40:41 -0800 (PST) Received: from mail1.gambling.com (mail1.gambling.com [207.139.179.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9EA0443F85; Tue, 4 Feb 2003 04:40:39 -0800 (PST) (envelope-from sheldonh@starjuice.net) Received: from [196.31.7.199] (helo=localhost) by mail1.gambling.com with esmtp (Exim 4.12) id 18g2NL-0008Kc-00; Tue, 04 Feb 2003 07:40:33 -0500 Received: from sheldonh by localhost with local (Exim 4.10) id 18g2N4-00021I-00; Tue, 04 Feb 2003 14:40:14 +0200 Date: Tue, 4 Feb 2003 14:40:14 +0200 From: Sheldon Hearn To: Tim Robbins Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/sh jobs.c Message-ID: <20030204124014.GM5702@starjuice.net> Mail-Followup-To: Tim Robbins , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org References: <200301270741.h0R7fCJe032467@repoman.freebsd.org> <20030203130740.GI30972@starjuice.net> <20030204224307.A8005@dilbert.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030204224307.A8005@dilbert.robbins.dropbear.id.au> User-Agent: Mutt/1.5.1i X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *18g2NL-0008Kc-00*/xa/2udTUpg* 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 On (2003/02/04 22:43), Tim Robbins wrote: > > > Ensure that the TTY file descriptor is greater than or equal to > > > 10 so that it doesn't interfere with the user's redirections. [...] > > Could you add how the magic number 10 was calculated to the comment you > > inserted? > > > > Also, it may be better for the comment to appear before the first use of > > the magic number 10. > > > > Also, it may be better to use a macro to represent the magic number 10, > > since it's used multiple times. > > I'll try to do something about it, but I'm not exactly sure where to > document it. The number 10 comes about because each file descriptor that > the user can manipulate is identified by a single digit. The magic number > is used 3 times in jobs.c, 9 times in redir.c and 2 times in input.c. If you use a macro to represent the number, then you can document it in the place you define it, possibly in shell.h. Then any existing comments relating to the magicness of the number can be removed. I'd use exactly the same description as you gave in the quoted text above, since that'll be a hint to future maintainers when things start blowing up again because someone changed redir.c. :-) Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message