Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2007 23:25:06 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org, Ed Maste <emaste@freebsd.org>
Subject:   Re: config(8) patch for review for src dir handling
Message-ID:  <20071223222506.GA64207@stack.nl>
In-Reply-To: <86ejddg354.fsf@ds4.des.no>
References:  <20071219222621.GA79432@sandvine.com> <86ejddg354.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 23, 2007 at 10:40:39AM +0100, Dag-Erling Smørgrav wrote:
> Ed Maste <emaste@freebsd.org> writes:
> > Right now config(8) calls realpath("../..", ... to find the src path
> > to write into the kernel Makefile.  I want to change this to use $PWD
> > with the last two path components removed, assuming it's the same dir
> > as ../.. .

> I'm worried that your patch assumes that $PWD is present and correct,
> for which there is no guarantee.  What happens if you use getcwd()
> instead of getenv("PWD")?

getcwd() does not use $PWD, it returns a pathname without symlinks.
So that would lead to the original behaviour.

A better way could be to use $PWD if it is set and an absolute logical
pathname referring to the current directory, as in src/bin/pwd/pwd.c .

-- 
Jilles Tjoelker



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