aboutsummaryrefslogtreecommitdiff
path: root/compat
Commit message (Collapse)AuthorAge
* Merge branch 'ef/setenv-putenv' into maintJunio C Hamano2011-12-28
|\ | | | | | | | | | | * ef/setenv-putenv: compat/setenv.c: error if name contains '=' compat/setenv.c: update errno when erroring out
| * compat/setenv.c: error if name contains '='Erik Faye-Lund2011-12-14
| | | | | | | | | | | | | | | | | | According to POSIX, setenv should error out with EINVAL if it's asked to set an environment variable whose name contains an equals sign. Implement this detail in our compatibility-fallback. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * compat/setenv.c: update errno when erroring outErik Faye-Lund2011-12-14
| | | | | | | | | | | | | | | | Previously, gitsetenv didn't update errno as it should when erroring out. Fix this. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/maint-snprintf-va-copy' into maintJunio C Hamano2011-12-28
|\ \ | | | | | | | | | | | | * jk/maint-snprintf-va-copy: compat/snprintf: don't look at va_list twice
| * | compat/snprintf: don't look at va_list twiceJeff King2011-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you define SNPRINTF_RETURNS_BOGUS, we use a special git_vsnprintf wrapper assumes that vsnprintf returns "-1" instead of the number of characters that you would need to store the result. To do this, it invokes vsnprintf multiple times, growing a heap buffer until we have enough space to hold the result. However, this means we evaluate the va_list parameter multiple times, which is generally a bad thing (it may be modified by calls to vsnprintf, yielding undefined behavior). Instead, we must va_copy it and hand the copy to vsnprintf, so we always have a pristine va_list. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'na/strtoimax' into maintJunio C Hamano2011-12-28
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | * na/strtoimax: Support sizes >=2G in various config options accepting 'g' sizes. Compatibility: declare strtoimax() under NO_STRTOUMAX Add strtoimax() compatibility function.
| * | Add strtoimax() compatibility function.Nick Alcock2011-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since systems that omit strtoumax() will likely omit strtomax() too, and likewise for strtoull() and strtoll(), we arrange for the make variables NO_STRTOUMAX and NO_STRTOULL to cover both the signed and unsigned functions, and define compatibility implementations for them. Signed-off-by: Nick Alcock <nix@esperi.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint-1.7.7' into maintJunio C Hamano2011-12-09
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * maint-1.7.7: am: don't persist keepcr flag mingw: give waitpid the correct signature git symbolic-ref: documentation fix
| * | | mingw: give waitpid the correct signatureErik Faye-Lund2011-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX says that last parameter to waitpid should be 'int', so let's make it so. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Revert "upload-archive: use start_command instead of fork"Junio C Hamano2011-11-15
| | | | | | | | | | | | | | | | | | | | This reverts commit c09cd77ea2fe3580b33918a99fe138d239ac2aaf, expecting a better version to be rerolled soon.
* | | | upload-archive: use start_command instead of forkErik Faye-Lund2011-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Erik Faye-Lund <kusmabite@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | compat/win32/poll.c: upgrade from upstreamErik Faye-Lund2011-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poll.c is updated from revision adc3a5b in git://git.savannah.gnu.org/gnulib.git The changes are applied with --whitespace=fix to reduce noise. poll.h is not upgraded, because the most recent version now contains template-stuff that breaks compilation for us. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | mingw: move poll out of sys-folderErik Faye-Lund2011-10-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both XSI and upstream Gnulib versions expects to find poll.h at the root of some include path, not inside the sys-folder. This helps us when upgrading Gnulib. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ss/inet-ntop'Junio C Hamano2011-10-21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * ss/inet-ntop: inet_ntop.c: Work around GCC 4.6's detection of uninitialized variables
| * | | | inet_ntop.c: Work around GCC 4.6's detection of uninitialized variablesSebastian Schuberth2011-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6 claims that error: 'best.len' may be used uninitialized in this function so silence that warning which is treated as an error by also initializing the "len" members of the struct. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'pt/mingw-misc-fixes'Junio C Hamano2011-10-18
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pt/mingw-misc-fixes: t9901: fix line-ending dependency on windows mingw: ensure sockets are initialized before calling gethostname mergetools: use the correct tool for Beyond Compare 3 on Windows t9300: do not run --cat-blob-fd related tests on MinGW git-svn: On MSYS, escape and quote SVN_SSH also if set by the user t9001: do not fail only due to CR/LF issues t1020: disable the pwd test on MinGW
| * | | | | mingw: ensure sockets are initialized before calling gethostnamePat Thoyts2011-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'bc/attr-ignore-case'Junio C Hamano2011-10-17
|\ \ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bc/attr-ignore-case: attr.c: respect core.ignorecase when matching attribute patterns attr: read core.attributesfile from git_default_core_config builtin/mv.c: plug miniscule memory leak cleanup: use internal memory allocation wrapper functions everywhere attr.c: avoid inappropriate access to strbuf "buf" member Conflicts: transport-helper.c
| * | | | | cleanup: use internal memory allocation wrapper functions everywhereBrandon Casey2011-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "x"-prefixed versions of strdup, malloc, etc. will check whether the allocation was successful and terminate the process otherwise. A few uses of malloc were left alone since they already implemented a graceful path of failure or were in a quasi external library like xdiff. Additionally, the call to malloc in compat/win32/syslog.c was not modified since the syslog() implemented there is a die handler and a call to the x-wrappers within a die handler could result in recursion should memory allocation fail. This will have to be addressed separately. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'ef/mingw-syslog'Junio C Hamano2011-10-17
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | * ef/mingw-syslog: mingw: avoid using strbuf in syslog
| * | | | | mingw: avoid using strbuf in syslogErik Faye-Lund2011-10-07
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strbuf can call die, which again can call syslog from git-daemon. Endless recursion is no fun; fix it by hand-rolling the logic. As a side-effect malloc/realloc errors are changed into non-fatal warnings; this is probably an improvement anyway. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Noticed-by: Johannes Sixt <j.sixt@viscovery.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | obstack.c: Fix some sparse warningsRamsay Jones2011-09-11
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, sparse issues the following warnings: compat/obstack.c:176:17: warning: Using plain integer as NULL pointer compat/obstack.c:224:17: warning: Using plain integer as NULL pointer compat/obstack.c:324:16: warning: Using plain integer as NULL pointer compat/obstack.c:329:16: warning: Using plain integer as NULL pointer compat/obstack.c:347:16: warning: Using plain integer as NULL pointer compat/obstack.c:362:19: warning: Using plain integer as NULL pointer compat/obstack.c:379:29: warning: Using plain integer as NULL pointer compat/obstack.c:399:1: error: symbol 'print_and_abort' redeclared with \ different type (originally declared at compat/obstack.c:95) \ - different modifiers Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | obstack: Fix portability issuesFredrik Kuivinen2011-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1, SunOS 5.10, and possibly others do not have exit.h and exitfail.h. Remove the use of these in obstack.c. The __block variable was renamed to block to avoid a gcc error: compat/obstack.h:190: error: __block attribute can be specified on variables only Initial-patch-by: David Aguilar <davvid@gmail.com> Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Fredrik Kuivinen <frekui@gmail.com> Acked-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Add obstack.[ch] from EGLIBC 2.10Fredrik Kuivinen2011-08-20
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Fredrik Kuivinen <frekui@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/maint-cygwin-trust-executable-bit-default'Junio C Hamano2011-07-13
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * jc/maint-cygwin-trust-executable-bit-default: cygwin: trust executable bit by default
| * | | | cygwin: trust executable bit by defaultJunio C Hamano2011-06-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier 7974843 (compat/cygwin.c: make runtime detection of lstat/stat lessor impact, 2008-10-23) fixed the low-level "do we use cygwin specific hacks for stat/lstat?" logic not to call into git_default_config() from random codepaths that are typically very late in the program, to prevent the call from potentially overwriting other variables that are initialized from the configuration. However, it forgot that on Cygwin, trust-executable-bit should default to true. Noticed by J6t, confirmed by Ramsay Jones, and the brown paper bag is on Gitster's head. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'rj/config-cygwin'Junio C Hamano2011-07-13
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rj/config-cygwin: config.c: Make git_config() work correctly when called recursively t1301-*.sh: Fix the 'forced modes' test on cygwin help.c: Fix detection of custom merge strategy on cygwin
| * | | | | t1301-*.sh: Fix the 'forced modes' test on cygwinRamsay Jones2011-06-16
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'forced modes' test fails on cygwin because the post-update hook loses it's executable bit when copied from the templates directory by git-init. The template loses it's executable bit because the lstat() function resolves to the "native Win32 API" implementation. This call to lstat() happens after git-init has set the "git_dir" (so has_git_dir() returns true), but before the configuration has been fully initialised. At this point git_config() does not find any config files to parse and returns 0. Unfortunately, the code used to determine the cygwin l/stat() function bindings did not check the return from git_config() and assumed that the config was complete and accessible once "git_dir" was set. In order to fix the test, we simply change the binding code to test the return value from git_config(), to ensure that it actually had config values to read, before determining the requested binding. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'ef/maint-win-verify-path'Junio C Hamano2011-06-29
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ef/maint-win-verify-path: verify_dotfile(): do not assume '/' is the path seperator verify_path(): simplify check at the directory boundary verify_path: consider dos drive prefix real_path: do not assume '/' is the path seperator A Windows path starting with a backslash is absolute
| * | | | | real_path: do not assume '/' is the path seperatorTheo Niessink2011-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Theo Niessink <theo@taletn.com> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'js/i18n-windows'Junio C Hamano2011-06-29
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * js/i18n-windows: Windows: teach getenv to do a case-sensitive search mingw.c: move definition of mingw_getenv down sh-i18n--envsubst: do not crash when no arguments are given
| * | | | | Windows: teach getenv to do a case-sensitive searchJohannes Sixt2011-06-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getenv() on Windows looks up environment variables in a case-insensitive manner. Even though all documentations claim that the environment is case-insensitive, it is possible for applications to pass an environment to child processes that has variables that differ only in case. Bash on Windows does this, for example, and sh-i18n--envsubst depends on this behavior. With this patch environment variables are first looked up in a case-sensitive manner; only if this finds nothing, the system's getenv() is used as a fallback. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | mingw.c: move definition of mingw_getenv downJohannes Sixt2011-06-06
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to use static lookup_env() in a subsequent change. At first sight, this change looks innocent. But it is not due to the #undef getenv. There is one caller of getenv between the old location and the new location whose behavior could change. But as can be seen from the defintion of mingw_getenv, the behavior for this caller does not change substantially. To ensure consistent behavior in the future, change all getenv callers in mingw.c to use mingw_getenv. With this patch, this is not a big deal, yet, but with the subsequent change, where we teach getenv to do a case-sensitive lookup, the behavior of all call sites is changed. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | compat/fnmatch/fnmatch.c: give a fall-back definition for NULLJunio C Hamano2011-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somebody tried to compile fnmatch.c compatibility file on Interix and got an error because no header included in the file on that platform defined NULL. It usually comes from stddef.h and indirectly from other headers like string.h, unistd.h, stdio.h, stdlib.h, etc., but with the way we compile this file from our Makefile, inclusion of the header files that are expected to define NULL in fnmatch.c do not happen because they are protected with "#ifdef STDC_HEADERS", etc. which we do not pass. As the least-impact workaround, give a fall-back definition when none of the headers define NULL. Noticed-by: Markus Duft <mduft@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'js/mingw-shutdown'Junio C Hamano2011-05-23
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | * js/mingw-shutdown: Windows: add a wrapper for the shutdown() system call
| * | | | Windows: add a wrapper for the shutdown() system callJohannes Sixt2011-05-18
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'sp/maint-fd-limit' into maintJunio C Hamano2011-03-20
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sp/maint-fd-limit: sha1_file.c: Don't retain open fds on small packs mingw: add minimum getrlimit() compatibility stub Limit file descriptors used by packs
* | | | | remove doubled words, e.g., s/to to/to/, and fix related typosJim Meyering2011-04-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I found that some doubled words had snuck back into projects from which I'd already removed them, so now there's a "syntax-check" makefile rule in gnulib to help prevent recurrence. Running the command below spotted a few in git, too: git ls-files | xargs perl -0777 -n \ -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt])\s+\1\b/gims)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g;' \ -e 'print "$ARGV:$n:$v\n"}' Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'maint'Junio C Hamano2011-03-16
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: Prepare draft release notes to 1.7.4.2 gitweb: highlight: replace tabs with spaces make_absolute_path: return the input path if it points to our buffer valgrind: ignore SSE-based strlen invalid reads diff --submodule: split into bite-sized pieces cherry: split off function to print output lines branch: split off function that writes tracking info and commit subject standardize brace placement in struct definitions compat: make gcc bswap an inline function enums: omit trailing comma for portability Conflicts: RelNotes
| * | | | compat: make gcc bswap an inline functionJonathan Nieder2011-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change, gcc -pedantic warns: cache.h: In function 'ce_to_dtype': cache.h:270:21: warning: ISO C forbids braced-groups within expressions [-pedantic] An inline function is more readable anyway. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jk/strbuf-vaddf'Junio C Hamano2011-03-15
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | * jk/strbuf-vaddf: compat: fall back on __va_copy if available strbuf: add strbuf_vaddf compat: provide a fallback va_copy definition
| * | | | compat: provide a fallback va_copy definitionJeff King2011-02-26
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | va_copy is C99. We have avoided using va_copy many times in the past, which has led to a bunch of cut-and-paste. From everything I found searching the web, implementations have historically either provided va_copy or just let your code assume that simple assignment of worked. So my guess is that this will be sufficient, though we won't really know for sure until somebody reports a problem. Signed-off-by: Jeff King <peff@peff.net> Improved-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'sp/maint-fd-limit'Junio C Hamano2011-03-15
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | * sp/maint-fd-limit: sha1_file.c: Don't retain open fds on small packs mingw: add minimum getrlimit() compatibility stub Limit file descriptors used by packs
| * | | mingw: add minimum getrlimit() compatibility stubErik Faye-Lund2011-03-02
| |/ / | | | | | | | | | | | | | | | | | | | | | We don't have getrlimit on Windows :( Limit of 2048 taken from MSDN: http://msdn.microsoft.com/en-us/library/6e3b887c(v=vs.71).aspx Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
* | | Merge branch 'hv/mingw-fs-funnies'Junio C Hamano2011-02-27
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | * hv/mingw-fs-funnies: mingw_rmdir: set errno=ENOTEMPTY when appropriate mingw: add fallback for rmdir in case directory is in use mingw: make failures to unlink or move raise a question mingw: work around irregular failures of unlink on windows mingw: move unlink wrapper to mingw.c
| * | mingw_rmdir: set errno=ENOTEMPTY when appropriateJohannes Schindelin2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, EACCES overrules ENOTEMPTY when calling rmdir(). But if the directory is busy, we only want to retry deleting the directory if it is empty, so test specifically for that case and set ENOTEMPTY rather than EACCES. Noticed by Greg Hazel. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | mingw: add fallback for rmdir in case directory is in useHeiko Voigt2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Heiko Voigt <heiko.voigt@mahr.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | mingw: make failures to unlink or move raise a questionHeiko Voigt2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows in case a program is accessing a file unlink or move operations may fail. To give the user a chance to correct this we simply wait until the user asks us to retry or fail. This is useful because of the following use case which seem to happen rarely but when it does it is a mess: After making some changes the user realizes that he was on the incorrect branch. When trying to change the branch some file is still in use by some other process and git stops in the middle of changing branches. Now the user has lots of files with changes mixed with his own. This is especially confusing on repositories that contain lots of files. Although the recent implementation of automatic retry makes this scenario much more unlikely lets provide a fallback as a last resort. Thanks to Albert Dvornik for disabling the question if users can't see it. If the stdout of the command is connected to a terminal but the stderr has been redirected, the odds are good that the user can't see any question we print out to stderr. This will result in a "mysterious hang" while the app is waiting for user input. It seems better to be conservative, and avoid asking for input whenever the stderr is not a terminal, just like we do for stdin. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Albert Dvornik <dvornik+git@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | mingw: work around irregular failures of unlink on windowsHeiko Voigt2011-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a file is opened by another process (e.g. indexing of an IDE) for reading it is not allowed to be deleted. So in case unlink fails retry after waiting for some time. This extends the workaround from 6ac6f878. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | mingw: move unlink wrapper to mingw.cHeiko Voigt2011-02-07
| | | | | | | | | | | | | | | | | | | | | The next patch implements a workaround in case unlink fails on Windows. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>