Skip to content

Commit 4b623d8

Browse files
slonopotamusgitster
authored andcommitted
MSVC: link in invalidcontinue.obj for better POSIX compatibility
By default, Windows abort()'s instead of setting errno=EINVAL when invalid arguments are passed to standard functions. For example, when PAGER quits and git detects it with errno=EPIPE on write(), check_pipe() in write_or_die.c tries raise(SIGPIPE) but since there is no SIGPIPE on Windows, it is treated as invalid argument, causing abort() and crash report window. Linking in invalidcontinue.obj (provided along with MS compiler) allows raise(SIGPIPE) to return with errno=EINVAL. Signed-off-by: Marat Radchenko <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cee0c27 commit 4b623d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config.mak.uname

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ ifeq ($(uname_S),Windows)
365365
compat/win32/dirent.o
366366
COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
367367
BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
368-
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
368+
EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj
369369
PTHREAD_LIBS =
370370
lib =
371371
ifndef DEBUG

0 commit comments

Comments
 (0)