This is the mail archive of the cygwin-developers@sourceware.cygnus.com 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]

Re: duplicate inode number


Kazuhiro Fujieda wrote:
> 
> I reported this problem and the patch resolving it once, but there
> has been no response. So I try to explain it more concretely.
> 
> As reported in the cygwin mailing list, `mv' sometime complains
> completely different files are the same file. Because these files
> have the same inode number.
> 
> For example,
> 
> $ touch 1 2 3 4 5
> $ mv 1 2
> mv: `1' and `2' are the same file
> $ ls -i
>    1447 1     1447 2     1445 3     1445 4     1447 5
> 
> This can be observed on Win9x in the snapshots since 12 Feb when the
> following changes are made.
> 
> Fri Feb 12 13:17:49 1999  Corinna Vinschen  <corinna.vinschen@cityweb.de>
> 
>         * fhandler.cc (fhandler_disk_file::fstat): Handles directories,
>         returns unique i-node number.
>         * syscalls.cc (stat_worker): On WinNT, stat_worker calls
>         fhandler_disk_file::fstat for directories, too.

Ok, I have patched it to old behaviour for 9X.

Thanks,
Corinna

ChangeLog:
==========

Sat Jun 12 22:22:00 1999  Corinna Vinschen  <corinna@vinschen.de>

	* fhandler.cc (fhandler_disk_file::fstat): For 9X, i-node numbers
	computed via `get_namehash' again.


Index: fhandler.cc
===================================================================
RCS file: /src/cvsroot/winsup-990602/fhandler.cc,v
retrieving revision 1.2
diff -u -p -r1.2 fhandler.cc
--- fhandler.cc 1999/06/12 20:07:08     1.2
+++ fhandler.cc 1999/06/12 20:20:34
@@ -882,7 +882,10 @@ fhandler_disk_file::fstat (struct stat *
   buf->st_nlink   = local.nNumberOfLinks;
   buf->st_dev     = local.dwVolumeSerialNumber;
   buf->st_size    = local.nFileSizeLow;
-  buf->st_ino     = local.nFileIndexHigh | local.nFileIndexLow;
+  if (os_being_run != winNT)
+    buf->st_ino   = local.nFileIndexLow ^ get_namehash ();
+  else
+    buf->st_ino   = local.nFileIndexHigh | local.nFileIndexLow;
   buf->st_blksize = S_BLKSIZE;
   buf->st_blocks  = (buf->st_size + S_BLKSIZE-1) / S_BLKSIZE;
   buf->st_uid     = get_file_owner (get_win32_name ());


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