From: Junio C Hamano Date: Fri, 03 Feb 2012 01:28:29 GMT Subject: Re: Problem pushing to a Novell share Message-ID: <7vfwesu2ma.fsf@alter.siamese.dyndns.org> In-Reply-To: RĂ¼diger Kessel writes: > Trying git_mkstemp_mode() first means trying more 16000 times to create a > random file before realizing that something might be wrong. Well, git_mkstemps_mode() does have such a 16k loop, and it tries to create a unique, unused file this way: fd = open(pattern, O_CREAT | O_EXCL | O_RDWR, mode); if (fd > 0) return fd; /* * Fatal error (EPERM, ENOSPC etc). * It doesn't make sense to loop. */ if (errno != EEXIST) break; If you do not have a directory D and try to create D/tmp_random here, shouldn't you get an error that is _NOT_ EEXIST and trigger this break?