git/compat
Yongqiang Tian 79ac6eff39 compat/winansi: fix die_lasterr() argument formatting
During WinANSI initialization, duplicate_handle() reports the handle
when DuplicateHandle() fails. die_lasterr() collects the formatting
arguments in a va_list, but passes that va_list to die_errno() as an
ordinary variadic argument. die_errno() consequently formats part of
the va_list representation instead of the supplied handle, producing
an incorrect fatal message.

The helper also converts GetLastError() to errno, losing the exact
Windows error code.

Remove die_lasterr() and report GetLastError() directly at its four
call sites, following the existing Windows diagnostic style. This
passes the handle to the formatter correctly and preserves the Windows
error code. Keep the existing %li representation of the handle.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Yongqiang Tian <yqtian668@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-09-21 17:15:04 -07:00
..
darwin trace2: add macOS process ancestry tracing 2026-02-13 12:18:31 -08:00
fsmonitor fsmonitor: implement filesystem change listener for Linux 2026-04-15 08:44:33 -07:00
linux treewide: remove unnecessary cache.h inclusion from several sources 2023-03-21 10:56:51 -07:00
poll unify and bump _WIN32_WINNT definition to Windows 8.1 2026-04-06 10:06:20 -07:00
regex compat/regex: explicitly mark intentional use of the comma operator 2025-03-28 17:38:11 -07:00
simple-ipc git-compat-util: introduce MEMZERO_ARRAY() macro 2025-12-11 14:44:43 +09:00
stub compat: mark unused parameters in win32/mingw functions 2024-08-28 09:51:18 -07:00
vcbuild mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
win32 Merge branch 'js/win-kill-child-more-gently' 2026-06-16 09:01:02 -07:00
.gitattributes
…
access.c
…
apple-common-crypto.h
…
basename.c compat/win32: fix const-correctness with string constants 2024-06-07 10:30:52 -07:00
bswap.h bswap.h: provide a built-in based version of bswap32/64 if possible 2025-07-15 14:36:51 -07:00
compiler.h mingw.c: Fix complier warnings for a 64 bit msvc 2024-10-17 14:42:27 -04:00
disk.h compat: drop inclusion of <git-compat-util.h> 2024-02-24 14:37:41 -08:00
fileno.c
…
fopen.c
…
hstrerror.c
…
inet_ntop.c
…
inet_pton.c
…
memmem.c
…
mingw-posix.h mingw: implement basic `symlink()` functionality (file symlinks only) 2026-01-09 18:32:55 -08:00
mingw.c mingw: really handle SIGINT 2026-06-05 22:39:57 +09:00
mingw.h compat/mingw: split out POSIX-related bits 2025-02-18 10:55:39 -08:00
mkdir.c
…
mmap.c compat/mmap: mark unused argument in git_munmap() 2025-11-18 09:36:05 -08:00
msvc-posix.h compat/msvc: use _chsize_s for ftruncate 2026-06-15 07:45:40 -07:00
msvc.c
…
msvc.h compat/mingw: split out POSIX-related bits 2025-02-18 10:55:39 -08:00
nonblock.c
…
nonblock.h
…
obstack.c
…
obstack.h
…
open.c object-file: move `git_open_cloexec()` to "compat/open.c" 2025-04-15 08:24:35 -07:00
posix.h win32: ensure that `localtime_r()` is declared even in i686 builds 2026-06-22 06:00:30 -07:00
pread.c treewide: remove double forward declaration of read_in_full 2023-04-11 08:52:11 -07:00
precompose_utf8.c Merge branch 'ak/typofixes' 2026-06-15 07:42:00 -07:00
precompose_utf8.h
…
qsort_s.c
…
regcomp_enhanced.c regexp: leave a pointer to resurrect workaround for Homebrew 2026-03-25 15:04:30 -07:00
setenv.c
…
sha1-chunked.c hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
sha1-chunked.h
…
snprintf.c
…
stat.c
…
strcasestr.c
…
strdup.c
…
strlcpy.c
…
strtoimax.c
…
strtoumax.c
…
terminal.c global: trivial conversions to fix `-Wsign-compare` warnings 2024-12-06 20:20:04 +09:00
terminal.h
…
unsetenv.c
…
win32.h mingw: teach dirent about symlinks 2026-01-09 18:32:55 -08:00
win32mmap.c global: mark code units that generate warnings with `-Wsign-compare` 2024-12-06 20:20:02 +09:00
winansi.c compat/winansi: fix die_lasterr() argument formatting 2026-09-21 17:15:04 -07:00
zlib-compat.h test-tool: add a helper to synthesize large packfiles 2026-05-09 11:25:32 +09:00