1. 17 10月, 2012 1 次提交
  2. 19 4月, 2012 1 次提交
    • R
      compat/mingw.h: Set S_ISUID to prevent a fast-import test failure · 90110d76
      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>
      90110d76
  3. 06 4月, 2012 1 次提交
    • R
      compat/mingw.[ch]: Change return type of exec functions to int · 1696d723
      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>
      1696d723
  4. 10 12月, 2011 1 次提交
  5. 16 11月, 2011 1 次提交
  6. 31 10月, 2011 1 次提交
  7. 16 10月, 2011 1 次提交
  8. 28 5月, 2011 1 次提交
  9. 19 5月, 2011 1 次提交
  10. 03 3月, 2011 1 次提交
  11. 08 2月, 2011 2 次提交
  12. 10 12月, 2010 1 次提交
  13. 24 11月, 2010 1 次提交
    • E
      win32: use our own dirent.h · d1b6e6e0
      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>
      d1b6e6e0
  14. 05 11月, 2010 5 次提交
  15. 14 10月, 2010 1 次提交
  16. 04 10月, 2010 2 次提交
  17. 02 10月, 2010 3 次提交
  18. 21 5月, 2010 2 次提交
  19. 12 4月, 2010 1 次提交
  20. 07 3月, 2010 1 次提交
  21. 26 2月, 2010 1 次提交
  22. 17 1月, 2010 3 次提交
    • A
      MSVC: Windows-native implementation for subset of Pthreads API · 44626dc7
      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>
      44626dc7
    • R
      MSVC: Fix an "incompatible pointer types" compiler warning · b6f714f8
      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>
      b6f714f8
    • J
      Windows: avoid the "dup dance" when spawning a child process · 75301f90
      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>
      75301f90
  23. 24 11月, 2009 1 次提交
  24. 09 11月, 2009 1 次提交
  25. 20 10月, 2009 1 次提交
  26. 19 9月, 2009 2 次提交
  27. 12 9月, 2009 1 次提交
  28. 06 7月, 2009 1 次提交