Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <052001c51939$1f0f16c0$e6ec6f83@robinson.cam.ac.uk> From: "Max Bowsher" To: Cc: References: <022220052341 DOT 28716 DOT 421BC32D000DA54F0000702C22007507440A050E040D0C079D0A AT comcast DOT net> Subject: Re: pwd output changed with coreutils upgrade from 5.2.1-4 to 5.3.0-2 Date: Tue, 22 Feb 2005 23:48:17 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ X-Cam-AntiVirus: No virus found X-Cam-SpamDetails: Not scanned X-IsSubscribed: yes Note-from-DJ: This may be spam ericblake AT comcast DOT net wrote: >> Hi all, >> >> I'm using the pwd.exe command from a standard winXP command prompt >> ( for building Mozilla ). >> >> However, when I upgrade to coreutils 5.3.0-2 I get this weird result: >> C:\devel\lgo\mozilla>pwd >> pwd: reading directory `../../../..' >> >> Even more strange, is that when I execute pwd from the command prompt, I >> hear >> my floppy disk being accessed. >> >> Can somebody help me out on this? Is this expected behaviour? >> > > I can reproduce the bug. It is because coreutils switched in 5.3.0 to > using > opendir("..")/readdir()/closedir() to find the child directory in .. with > the > same inode as stat("."). However, using the readdir() sequence on > "/cygdrive": > a) scans all Windows drives, including floppies (hence the sound of your > disk > access) > b) tickles a cygwin bug where closedir() incorrectly returns -1 without > setting errno (hence the cryptic error message from pwd) > > The bug never bit me in testing because I tested from mount points other > than > /cygdrive. > > Also, there is a known bug in coreutils, > http://lists.gnu.org/archive/html/bug-coreutils/2005-02/msg00085.html, > that > pwd(1) is not POSIX compliant because it does not have a -L option that > defaults to reading $PWD rather than assuming -P and scanning inodes. > > Until such time as a cygwin snapshot fixes closedir() to work correctly > (hopefully by cygwin 1.5.13), or such time as I release a coreutils with a > compiled in hack to ignore the return of closedir if errno is unchanged, > you > have two workarounds: > a) rather than using /bin/pwd, use the builtin pwd of /bin/sh or /bin/bash > b) use mount(1) to ensure that your files can be accessed without having > to > use /cygdrive as their prefix Wouldn't it be far more appropriate to hold back 5.3.0 as a test package, leaving 5.2.1 as current until such time as 5.3.0 can be considered ready? In fact, unless you think that is a bad idea, I'll go ahead and change setup.hint accordingly. Waiting an hour for possible reply.... Max. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/