Re: config(8) patch for review for src dir handling



On Sun, Dec 23, 2007 at 10:40:39AM +0100, Dag-Erling Sm??rgrav wrote:

Ed Maste <emaste@xxxxxxxxxxx> 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")?

The patch assumes neither; it checks for $PWD and verifies that the dir
obtained by removing the last two components is the same as that
provided by realpath("../.." . If $PWD is not set, or the path based on
it is not correct, it falls back to the current behaviour -- the path
returned by realpath("../.." .

Getcwd doesn't give the desired behaviour since, like realpath, it
returns the physical directory.

-Ed
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: timidity, ffmpeg and other
    ... has no OS/2 support like dart_a.c. ... Simplest would be to DL the equivalent source and use diff to create a patch then try applying the patch to 2.13.2. ... Couple of gotchas with FFmpeg, ... Ash has a problem where it does not set $PWD until you do a cd. ...
    (comp.os.os2.programmer.porting)
  • Re: timidity, ffmpeg and other
    ... has no OS/2 support like dart_a.c. ... You will need to patch it. ... (And it was Darwin ... Look in config.err for the line that starts with PWD. ...
    (comp.os.os2.programmer.porting)
  • Re: libfetch ftp patch for less latency
    ... Nate Lawson writes: ... Add my patch -- if a server returns an error, I see no way it would ... have changed the PWD. ...
    (freebsd-current)
  • Re: libfetch ftp patch for less latency
    ... Dag-Erling Smørgrav wrote: ... Add my patch -- if a server returns an error, I see no way it would ... have changed the PWD. ...
    (freebsd-current)
  • Re: Ruby path for SVN log XML -> HTML
    ... BTW: I got a nil String error from $PWD. ... Here's my patch, ...
    (comp.lang.ruby)