This is the mail archive of the mailing list for the Cygwin project.

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

[PATCH] Caching in's chdir

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 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

---     Thu Jun 15 16:33:06 2000
+++ 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,
+  syscall_printf ("%d = chdir (%s <dos %s>)", res, dir,
   return res;

Want to unsubscribe from this list?
Send a message to

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