- 17 10月, 2012 1 次提交
-
-
由 Johannes Sixt 提交于
check to compat Commit b2f5e268 (Windows: Work around an oddity when a pipe with no reader is written to) introduced a check for EINVAL after fflush() to fight spurious "Invalid argument" errors on Windows when a pipe was broken. But this check may hide real errors on systems that do not have the this odd behavior. Introduce an fflush wrapper in compat/mingw.* so that the treatment is only applied on Windows. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 19 4月, 2012 1 次提交
-
-
由 Ramsay Jones 提交于
The current t9300-fast-import.sh test number 62 ("L: nested tree copy does not corrupt deltas") was introduced in commit 9a0edb79 ("fast-import: add a test for tree delta base corruption", 15-08-2011). A fix for the demonstrated problem was introduced by commit 8fb3ad76 ("fast-import: prevent producing bad delta", 15-08-2011). However, this fix didn't work on MinGW and so this test has always failed on MinGW. Part of the solution in commit 8fb3ad76 was to add an NO_DELTA preprocessor constant which was defined as follows: +/* + * We abuse the setuid bit on directories to mean "do not delta". + */ +#define NO_DELTA S_ISUID + Unfortunately, the S_ISUID constant on MinGW is defined as zero. In order to fix the problem, we simply alter the definition of S_ISUID in the mingw header file to a more appropriate value. Also, we take the opportunity to similarly define S_ISGID and S_ISVTX. Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 06 4月, 2012 1 次提交
-
-
由 Ramsay Jones 提交于
The POSIX standard specifies a return type of int for all six exec functions. In addition, all exec functions return -1 on error, and simply do not return on success. However, the current emulation of the exec functions on mingw are declared with a void return type. This would cause a problem should any code attempt to call the exec function in a non-void context. In particular, if an exec function were used in a conditional it would fail to compile. In order to improve the fidelity of the emulation, we change the return type of the mingw_execv[p] functions to int and return -1 on error. Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 10 12月, 2011 1 次提交
-
-
由 Erik Faye-Lund 提交于
POSIX says that last parameter to waitpid should be 'int', so let's make it so. Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 16 11月, 2011 1 次提交
-
-
由 Junio C Hamano 提交于
This reverts commit c09cd77e, expecting a better version to be rerolled soon.
-
- 31 10月, 2011 1 次提交
-
-
由 Erik Faye-Lund 提交于
The POSIX-function fork is not supported on Windows. Use our start_command API instead. As this is the last call-site that depends on the fork-stub in compat/mingw.h, remove that as well. Add an undocumented flag to git-archive that tells it that the action originated from a remote, so features can be disabled. Thanks to Jeff King for work on this part. Remove the NOT_MINGW-prereq for t5000, as git-archive --remote now works. Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Helped-by: NJeff King <peff@peff.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 16 10月, 2011 1 次提交
-
-
由 Pat Thoyts 提交于
If the Windows sockets subsystem has not been initialized yet then an attempt to get the hostname returns an error and prints a warning to the console. This solves this issue for msysGit as seen with 'git fetch'. Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 28 5月, 2011 1 次提交
-
-
由 Theo Niessink 提交于
real_path currently assumes it's input had '/' as path seperator. This assumption does not hold true for the code-path from prefix_path (on Windows), where real_path can be called before normalize_path_copy. Fix real_path so it doesn't make this assumption. Create a helper function to reverse-search for the last path-seperator in a string. Signed-off-by: NTheo Niessink <theo@taletn.com> Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 19 5月, 2011 1 次提交
-
-
由 Johannes Sixt 提交于
Even though Windows's socket functions look like their POSIX counter parts, they do not operate on file descriptors, but on "socket objects". To bring the functions in line with POSIX, we have proxy functions that wrap and unwrap the socket objects in file descriptors using open_osfhandle and get_osfhandle. But shutdown() was not proxied, yet. Fix this. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 03 3月, 2011 1 次提交
-
-
由 Erik Faye-Lund 提交于
We don't have getrlimit on Windows :( Limit of 2048 taken from MSDN: http://msdn.microsoft.com/en-us/library/6e3b887c(v=vs.71).aspxSigned-off-by: NErik Faye-Lund <kusmabite@gmail.com>
-
- 08 2月, 2011 2 次提交
-
-
由 Heiko Voigt 提交于
The same logic as for unlink and rename also applies to rmdir. For example in case you have a shell open in a git controlled folder. This will easily fail. So lets be nice for such cases as well. Signed-off-by: NHeiko Voigt <heiko.voigt@mahr.de> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Heiko Voigt 提交于
The next patch implements a workaround in case unlink fails on Windows. Signed-off-by: NHeiko Voigt <hvoigt@hvoigt.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 10 12月, 2010 1 次提交
-
-
由 Ramsay Jones 提交于
Commit 4091bfc9 (MinGW: Add missing file mode bit defines, 28-12-2009) causes the msvc build to issue many additional (currently 1008) macro redefinition warnings. The warnings relate to the S_IRUSR, S_IWUSR, S_IXUSR and S_IRWXU macros. In order to fix the warnings, we simply remove the offending macro definitions which, for both msvc and MinGW, are not required. Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: NSebastian Schuberth <sschuberth@gmail.com> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 24 11月, 2010 1 次提交
-
-
由 Erik Faye-Lund 提交于
The mingw-runtime implemenation of opendir, readdir and closedir sets errno to 0 on success, something that POSIX explicitly forbids. 3ba7a065 ("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: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 05 11月, 2010 5 次提交
-
-
由 Erik Faye-Lund 提交于
Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Erik Faye-Lund 提交于
This is a quite limited kill-emulation; it can only handle SIGTERM on positive pids. However, it's enough for git-daemon. Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Erik Faye-Lund 提交于
Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Erik Faye-Lund 提交于
The Windows port have so far been using process handles in place of PID. However, this is not work consistent with what getpid returns. PIDs are system-global identifiers, but process handles are local to a process. Using PIDs instead of process handles allows, for instance, a user to kill a hung process with the Task Manager, something that would have been impossible with process handles. Change the code to use the real PID, and use OpenProcess to get a process-handle. Store the PID and the process handle in a linked list protected by a critical section, so we can safely close the process handle later. Linked list code written by Pat Thoyts. Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Mike Pape 提交于
git-daemon requires some socket-functionality that is not yet supported in the Windows-port. This patch adds said functionality, and makes sure WSAStartup gets called by socket(), since it is the first network-call in git-daemon. Signed-off-by: NMike Pape <dotzenlabs@gmail.com> Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 14 10月, 2010 1 次提交
-
-
由 Ilari Liusvaara 提交于
This helper function copies bidirectional stream of data between stdin/stdout and specified file descriptors. Signed-off-by: NIlari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 04 10月, 2010 2 次提交
-
-
由 Eric Sunshine 提交于
As of 2dbc887e, shell.c employs execv(), so provide a MinGW-specific mingw_execv() override, complementing existing mingw_execvp() and cousins. As a bonus, this also resolves a compilation warning due to an execv() prototype mismatch between Linux and MinGW. Linux expects the second argument to be (char *const *), whereas MinGW expects (const char *const *). Acked-by: NJohannes Schindelin <johannes.schindelin@gmx.de> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NEric Sunshine <sunshine@sunshineco.com> Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net>
-
由 Eric Sunshine 提交于
shell.c defines macro HELP_COMMAND which collides with a like-named macro from winuser.h. Avoid collision by sanitizing preprocessor namespace after including Windows headers. Acked-by: NJohannes Schindelin <johannes.schindelin@gmx.de> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NEric Sunshine <sunshine@sunshineco.com> Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net>
-
- 02 10月, 2010 3 次提交
-
-
由 Pat Thoyts 提交于
In msysGit the stat() function has been implemented using mingw_lstat which sets the st_mode member to S_IFLNK when a symbolic links is found. This causes the is_executable function to return when git attempts to build a list of available commands in the help code and we end up missing most git commands. (msysGit issue #445) This patch modifies the implementation so that lstat() will return the link flag but if we are called as stat() we read the size of the target and set the mode to that of a regular file. Includes squashed fix st_mode for symlink dirs Signed-off-by: NPat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com>
-
由 Sebastian Schuberth 提交于
Signed-off-by: NSebastian Schuberth <sschuberth@gmail.com>
-
由 Sebastian Schuberth 提交于
Signed-off-by: NSebastian Schuberth <sschuberth@gmail.com>
-
- 21 5月, 2010 2 次提交
-
-
由 Erik Faye-Lund 提交于
Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 René Scharfe 提交于
Bigger writes to network drives on Windows XP fail. Cap them at 31MB to allow them to succeed. Callers need to be prepared for write() calls that do less work than requested anyway. On local drives, write() calls are translated to WriteFile() calls with a cap of 64KB on Windows XP and 256KB on Vista. Thus a cap of 31MB won't affect the number of WriteFile() calls which do the actual work. There's still room for some other version of Windows to use a chunk size of 1MB without increasing the number of system calls. Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 12 4月, 2010 1 次提交
-
-
由 Johannes Sixt 提交于
A caller of start_command can set the member 'dir' to a directory to request that the child process starts with that directory as CWD. The first user of this feature was added recently in eee49b6c (Teach diff --submodule and status to handle .git files in submodules). On Windows, we have been lazy and had not implemented support for this feature, yet. This fixes the shortcoming. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 07 3月, 2010 1 次提交
-
-
由 Johannes Sixt 提交于
Obviously, this function was never called with two arguments in Windows code sections, but this will be the case in a subsequent patch. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 26 2月, 2010 1 次提交
-
-
由 Johannes Sixt 提交于
On Windows, the equivalent of "/dev/null" is "nul". This implements compatibility wrappers around fopen() and freopen() that check for this particular file name. The new tests exercise code paths where this is relevant. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 17 1月, 2010 3 次提交
-
-
由 Andrzej K. Haczewski 提交于
This patch implements native to Windows subset of pthreads API used by Git. It allows to remove Pthreads for Win32 dependency for MSVC, msysgit and Cygwin. [J6t: If the MinGW build was built as part of the msysgit build environment, then threading was already enabled because the pthreads-win32 package is available in msysgit. With this patch, we can now enable threaded code unconditionally.] Signed-off-by: NAndrzej K. Haczewski <ahaczewski@gmail.com> Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Ramsay Jones 提交于
In particular, the following warning is issued while compiling compat/msvc.c: ...mingw.c(223) : warning C4133: 'function' : incompatible \ types - from '_stati64 *' to '_stat64 *' which relates to a call of _fstati64() in the mingw_fstat() function definition. This is caused by various layers of macro magic and attempts to avoid macro redefinition compiler warnings. For example, the call to _fstati64() mentioned above is actually a call to _fstat64(), and expects a pointer to a struct _stat64 rather than the struct _stati64 which is passed to mingw_fstat(). The definition of struct _stati64 given in compat/msvc.h had the same "shape" as the definition of struct _stat64, so the call to _fstat64() does not actually cause any runtime errors, but the structure types are indeed incompatible. In order to avoid the compiler warning, we add declarations for the mingw_lstat() and mingw_fstat() functions and supporting macros to msvc.h, suppressing the corresponding declarations in mingw.h, so that we can use the appropriate structure type (and function) names from the msvc headers. Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Johannes Sixt 提交于
When stdin, stdout, or stderr must be redirected for a child process that on Windows is spawned using one of the spawn() functions of Microsoft's C runtime, then there is no choice other than to 1. make a backup copy of fd 0,1,2 with dup 2. dup2 the redirection source fd into 0,1,2 3. spawn 4. dup2 the backup back into 0,1,2 5. close the backup copy and the redirection source We used this idiom as well -- but we are not using the spawn() functions anymore! Instead, we have our own implementation. We had hardcoded that stdin, stdout, and stderr of the child process were inherited from the parent's fds 0, 1, and 2. But we can actually specify any fd. With this patch, the fds to inherit are passed from start_command()'s WIN32 section to our spawn implementation. This way, we can avoid the backup copies of the fds. The backup copies were a bug waiting to surface: The OS handles underlying the dup()ed fds were inherited by the child process (but were not associated with a file descriptor in the child). Consequently, the file or pipe represented by the OS handle remained open even after the backup copy was closed in the parent process until the child exited. Since our implementation of pipe() creates non-inheritable OS handles, we still dup() file descriptors in start_command() because dup() happens to create inheritable duplicates. (A nice side effect is that the fd cleanup in start_command is the same for Windows and Unix and remains unchanged.) Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 24 11月, 2009 1 次提交
-
-
由 Martin Storsjö 提交于
The IPv6 support functions are loaded dynamically, to maintain backwards compatibility with versions of Windows prior to XP, and fallback wrappers are provided, implemented in terms of gethostbyname and gethostbyaddr. Signed-off-by: NMartin Storsjo <martin@martin.st> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 09 11月, 2009 1 次提交
-
-
由 Ramsay Jones 提交于
When the NO_MMAP build variable is set, the msvc linker complains: error LNK2001: unresolved external symbol _getpagesize The msvc libraries do not define the getpagesize() function, so we move the mingw_getpagesize() implementation from the conditionally built win32mmap.c file to mingw.c. Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 20 10月, 2009 1 次提交
-
-
由 Erik Faye-Lund 提交于
SSL_set_fd (and friends) expects a OS file handle on Windows, not a file descriptor as on UNIX(-ish). This patch makes the Windows version of SSL_set_fd behave like the UNIX versions, by calling _get_osfhandle on it's input. Signed-off-by: NErik Faye-Lund <kusmabite@gmail.com> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 19 9月, 2009 2 次提交
-
-
由 Marius Storm-Olsen 提交于
Centralize the include of windows.h in git-compat-util.h, turn on WIN32_LEAN_AND_MEAN to avoid including plenty of other header files which is not needed in Git. Also ensure we load winsock2.h first, so we don't load the older winsock definitions at a later stage, since they contain duplicate definitions. When moving windows.h into git-compat-util.h, we need to protect the definition of struct pollfd in mingw.h, since this file is used by both MinGW and MSVC, and the latter defines this struct in winsock2.h. We need to keep the windows.h include in compat/win32.h, since its shared by both MinGW and Cygwin, and we're not touching Cygwin in this commit. The include in git-compat-util.h is protected with an ifdef WIN32, which is not the case when compiling for Cygwin. Signed-off-by: NMarius Storm-Olsen <mstormo@gmail.com> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
由 Marius Storm-Olsen 提交于
MinGW set the _CRT_fmode to set both the default fmode and _O_BINARY on stdin/stdout/stderr. Rather use the main() define in mingw.h to set this for both MinGW and MSVC. This will ensure that a MinGW and MSVC build will handle input and output identically. Signed-off-by: NMarius Storm-Olsen <mstormo@gmail.com> Acked-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 12 9月, 2009 1 次提交
-
-
由 Johannes Sixt 提交于
Previously, it would not be possible to call start_command twice for the same struct child_process that has env set. The fix is achieved by moving the loop that modifies the environment block into a helper function. This also allows us to make two other helper functions static. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-
- 06 7月, 2009 1 次提交
-
-
由 Johannes Sixt 提交于
Windows does not have signals. At least they cannot be diagnosed by the parent process; all that the parent process can observe is the exit code. This also adds a dummy definition of WTERMSIG. Signed-off-by: NJohannes Sixt <j6t@kdbg.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
-