delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/08/09:19:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Tue, 8 Jan 2008 15:19:17 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Trouble with cygwin git
Message-ID: <20080108141917.GA29568@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <376007 DOT 24556 DOT qm AT web45909 DOT mail DOT sp1 DOT yahoo DOT com> <loom DOT 20080102T190832-291 AT post DOT gmane DOT org>
MIME-Version: 1.0
In-Reply-To: <loom.20080102T190832-291@post.gmane.org>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Jan  2 19:35, MP wrote:
> I dug into this, and found that the failure happens here:
> 
>     res = fh->link (newpath);
> 
> in the link() function of file src/winsup/cygwin/syscalls.cc.  res is -1, and 
> errno == EEXIST at this point.
> 
> In the call above, newpath is:
> /cygdrive/c/git/git/.git/objects/pack/pack-
> d629a7029e3a941884c4bea2b33cc27e32f55779.pack
> 
> Digging further, this line fails:
> 
>     if (CreateHardLinkA (newpc, pc, NULL))
>       goto success;
> 
> in function fhandler_disk_file::link(), fhandler_disk_file.cc.  CreateHardLinkA
> () returns 0, and GetLastError() returns 183 (ERROR_ALREADY_EXISTS: Cannot 
> create a file when that file already exists).
> 
> In the CreateHardLinkA() call above, newpc.get_win32() yields:
> c:\git\git\.git\objects\pack\pack-d629a7029e3a941884c4bea2b33cc27e32f55779.pack
> 
> pc.get_win32() yields:
> c:\git\git\.git\objects\tmp_pack_btsO9s
> 
> I know that the destination file (newpc) does not exist; so I am perplexed why 
> CreateHardLinkA() is failing.  In the CreateHardLink() documentation on MSDN, 
> I see this comment:
> 
> "if you open a file that does not allow sharing, another application cannot 
> share the file by creating a new hard link to the file"
> 
> However, I see that all calls to CreateFile() in XP Cygwin happen with:
> 
> FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
> 
> Any ideas why CreateHardLinkA() could still be failing?

Could you create a simple, self-contained testcase in plain C, which
allows to reproduce the problem?


Corinna


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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