delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/15/18:16:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Thu, 15 Jun 2000 18:15:12 -0400
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: [PATCH] Caching in path.cc's chdir
Message-ID: <20000615181511.A31631@cygnus.com>
Reply-To: cygwin AT sourceware DOT cygnus DOT com
Mail-Followup-To: cygwin AT sourceware DOT cygnus DOT com
References: <FEEGLKLAJFLHOLFDEPDJIENOCAAA DOT townba AT pobox DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.2i
In-Reply-To: <FEEGLKLAJFLHOLFDEPDJIENOCAAA.townba@pobox.com>; from townba@pobox.com on Thu, Jun 15, 2000 at 06:03:12PM -0400

I appreciate your taking the time to track down where the problem
lies but reverting the code to the old behavior is not the way
I'd like to fix this problem.  But you probably know that.

I've already made some changes to this code today and have added
an else block to the test.  The new code is in CVS now if you
want to check it.

cgf

On Thu, Jun 15, 2000 at 06:03:12PM -0400, Bradley A. Town wrote:
>I noticed that the latest snapshot of Cygwin was causing the
>CVS command "cvs co binutils" with my Cygwin build of CVS to
>fail.  I traced the problem using strace to a recent change to
>chdir.
>
>chdir is always caching the intended new working directory,
>regardless of the result of calling SetCurrentDirectoryA.  I took
>out the caching code in chdir, forcing cygwin to get the current
>working directory later.  The problem went away.
>
>My first solution had been to put the offending code in an else
>block, but that didn't solve all the problems.  I will try to
>work on a better solution tomorrow if I have time.
>
>Please excuse the crudeness of this patch.
>
>Brad Town
>
>
>--- path.cc     Thu Jun 15 16:33:06 2000
>+++ path.cc.new Thu Jun 15 17:54:29 2000
>@@ -2470,14 +2470,12 @@
>
>   /* Clear the cache until we need to retrieve the directory
>again.  */
>   free (cwd_win32);
>-  cwd_win32 = strdup (path);;
>+  cwd_win32 = NULL;
>
>-  char pathbuf[MAX_PATH];
>-  (void) normalize_posix_path (cwd_posix, dir, pathbuf);
>   free (cwd_posix);
>-  cwd_posix = strdup (pathbuf);
>+  cwd_posix = NULL;
>
>-  syscall_printf ("%d = chdir (%s <dos %s>)", res, cwd_posix,
>cwd_win32);
>+  syscall_printf ("%d = chdir (%s <dos %s>)", res, dir,
>native_dir);
>   return res;
> }
>
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

-- 
cgf AT cygnus DOT com                        Cygnus Solutions, a Red Hat company
http://sourceware.cygnus.com/         http://www.redhat.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019