[PATCH] cygcheck: follow symbolic links

Igor Peshansky pechtcha@cs.nyu.edu
Fri Feb 17 14:05:00 GMT 2006


On Fri, 17 Feb 2006, Dave Korn wrote:

> On 16 February 2006 17:27, Igor Peshansky wrote:
>
> > On Thu, 16 Feb 2006, Corinna Vinschen wrote:
>
> >> - Couldn't you just reuse the readlink implementation in ../cygwin/path.cc
> >>   as is, to avoid having to different implementations?
> >
> > Umm, most of that code is very general purpose, and has too much extra
> > stuff in it.
>
>   I think you may have misoptimised for speed rather than
> maintainability. Cygcheck isn't something that people expect to run a
> million times per second in an inner loop.

No, but I thought ease of understanding implied maintainability...
Besides, I'm sure binutils, for one, has the code for reading chunks of
application code and finding the DLL dependencies -- why aren't we reusing
that?  The answer: too much work to extract the needed bits in the form
that would be usable in both places.

> >  I basically used part of it (symlink_info::check_shortcut)
> > for my implementation.  I wanted something lightweight and easy to
> > understand
>
>   Perhaps you could have just exported it (or a convenient interface to
> it) instead?

Ahem.  You are forgetting that cygcheck is not a Cygwin program, so we
can't introduce a dependency on cygwin1.dll.  We'd have to create an
independent (static?) library that both cygcheck and Cygwin depended on...

> >(also, the code in path.cc doesn't check for PE headers, so I
> > had to write that part anyway).
>
>   None of which affects /that/ bit.

Right, I guess...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha@cs.nyu.edu | igor@watson.ibm.com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"



More information about the Cygwin-patches mailing list