<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat/msvc.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2010-11-24T00:06:50Z</updated>
<entry>
<title>win32: use our own dirent.h</title>
<updated>2010-11-24T00:06:50Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d1b6e6e015501272c7491b3a4adf3cd3904edefa'/>
<id>urn:sha1:d1b6e6e015501272c7491b3a4adf3cd3904edefa</id>
<content type='text'>
The mingw-runtime implemenation of opendir, readdir and closedir
sets errno to 0 on success, something that POSIX explicitly
forbids. 3ba7a06 ("A loose object is not corrupt if it cannot be
read due to EMFILE") introduce a dependency on this behaviour,
leading to a broken "git clone" on Windows.

compat/mingw.c contains an implementation of readdir, and
compat/msvc.c contains implementations of opendir and closedir.

Move these to compat/win32/dirent.[ch], and change to our own DIR
structure at the same time.

This provides a generic Win32-implementation of opendir, readdir
and closedir which works on both MinGW and MSVC and does not reset
errno, and as a result git clone is working again on Windows.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>msvc: opendir: handle paths ending with a slash</title>
<updated>2010-11-24T00:06:47Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad'/>
<id>urn:sha1:e7772600e94146ddbf5ef6b08d0ea7d6fc8fbcad</id>
<content type='text'>
Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: dirent: handle errors</title>
<updated>2010-11-24T00:06:47Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9585ed519c59d5ac46f8e12b339220cdd0567b7d'/>
<id>urn:sha1:9585ed519c59d5ac46f8e12b339220cdd0567b7d</id>
<content type='text'>
Previously all error conditions were ignored. Be nice, and set errno
when we should.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>msvc: opendir: do not start the search</title>
<updated>2010-11-24T00:06:46Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=20c6788aced1237489824db3b25285afed0ad169'/>
<id>urn:sha1:20c6788aced1237489824db3b25285afed0ad169</id>
<content type='text'>
compat/mingw.c's readdir expects to be the one that starts the search,
and if it isn't, then the first entry will be missing or incorrect.

Fix this by removing the call to _findfirst, and initializing dd_handle
to INVALID_HANDLE_VALUE.

At the same time, make sure we use FindClose instead of _findclose,
which is symmetric to readdir's FindFirstFile. Take into account that
the find-handle might already be closed by readdir.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>msvc: opendir: allocate enough memory</title>
<updated>2010-11-24T00:06:46Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17194c1e96eddb43d2608fe7bd121256d17118ee'/>
<id>urn:sha1:17194c1e96eddb43d2608fe7bd121256d17118ee</id>
<content type='text'>
The defintion of DIR expects the allocating function to extend
dd_name by over-allocating. This is not currently done in our
implementation of opendir. Fix this.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>msvc: opendir: fix malloc-failure</title>
<updated>2010-11-24T00:06:46Z</updated>
<author>
<name>Erik Faye-Lund</name>
<email>kusmabite@gmail.com</email>
</author>
<published>2010-11-23T18:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=599b0bf438e387dbaf00dbadcbe41b2a0de90db1'/>
<id>urn:sha1:599b0bf438e387dbaf00dbadcbe41b2a0de90db1</id>
<content type='text'>
Previsouly, the code checked for malloc-failure after it had accessed
the returned pointer. Move the check a bit earlier to avoid segfault.

Signed-off-by: Erik Faye-Lund &lt;kusmabite@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add platform files for porting to MSVC</title>
<updated>2009-09-19T03:00:42Z</updated>
<author>
<name>Frank Li</name>
<email>lznuaa@gmail.com</email>
</author>
<published>2009-09-16T08:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d75f8e61315cc502c34aec6600db00a7c7192ffd'/>
<id>urn:sha1:d75f8e61315cc502c34aec6600db00a7c7192ffd</id>
<content type='text'>
Add msvc.c and msvc.h to build git under MSVC.

Signed-off-by: Frank Li &lt;lznuaa@gmail.com&gt;
Signed-off-by: Marius Storm-Olsen &lt;mstormo@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
