This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Better realpath


> Date: Sat, 14 Jun 2008 23:26:54 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Vladimir Prus <vladimir@codesourcery.com>,
> 	gdb-patches@sources.redhat.com
> 
> It seems to me that the thing to do is eliminate gdb_realpath in favor
> of lrealpath.  That's supposed to be a portable version of realpath,
> so realpath semantics seem like the way to go.

I don't mind doing so, although libiberty has other customers, which
could make it harder for us to do what we think is right (if it
happens to be different from what lrealpath does now).  Note that
right now, lrealpath does not behave consistently with realpath (if
the latter is unavailable), so it cannot be regarded as a portable
version of realpath, at least not entirely so.

> Why do you think realpath's behavior is wrong for GDB?

Not just for GDB, in general as well: it doesn't seem right to me to
expand a file name and check for its existence in the same primitive,
not to mention refuse to produce an expansion if the file does not
exist.  These are two separate tests, so they should be kept separate.
(I actually suspect that realpath was used because it's more
convenient -- no messy memory allocation issues -- but I have no facts
to back this up.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]