Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com X-Authentication-Warning: testprod.com: Host dyn1-tnt9-64.detroit.mi.ameritech.net [209.18.27.64] claimed to be btown1 From: "Bradley A. Town" To: Subject: [PATCH] Caching in path.cc's chdir Date: Thu, 15 Jun 2000 18:03:12 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Hello all! 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 )", res, cwd_posix, cwd_win32); + syscall_printf ("%d = chdir (%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