Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <3762C2DB.E7F2AC90@vinschen.de> Date: Sat, 12 Jun 1999 22:28:11 +0200 From: Corinna Vinschen X-Mailer: Mozilla 4.6 [en] (WinNT; I) X-Accept-Language: de,en MIME-Version: 1.0 To: cygwin-developers AT sourceware DOT cygnus DOT com CC: Kazuhiro Fujieda Subject: Re: duplicate inode number References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 > > * 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 * 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 ());