Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 2003 14:40:14 +0200
From:      Sheldon Hearn <sheldonh@starjuice.net>
To:        Tim Robbins <tjr@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/bin/sh jobs.c
Message-ID:  <20030204124014.GM5702@starjuice.net>
In-Reply-To: <20030204224307.A8005@dilbert.robbins.dropbear.id.au>
References:  <200301270741.h0R7fCJe032467@repoman.freebsd.org> <20030203130740.GI30972@starjuice.net> <20030204224307.A8005@dilbert.robbins.dropbear.id.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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