mirror of
https://github.com/git/git.git
synced 2026-03-17 20:20:08 +01:00
Support NO_UNIX_SOCKETS
The year is 2011AD. Desktop computers are entirely occupied by POSIX-conforming operating systems. Well, not entirely...! One small operating system of indomitable APIs still holds out against the invaders, their POSIX functions and datatypes... and their Unix sockets. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
6
Makefile
6
Makefile
@@ -258,6 +258,8 @@ all::
|
||||
# dependency rules.
|
||||
#
|
||||
# Define NATIVE_CRLF if your platform uses CRLF for line endings.
|
||||
#
|
||||
# Define NO_UNIX_SOCKETS if your platform does not have them.
|
||||
|
||||
GIT-VERSION-FILE: FORCE
|
||||
@$(SHELL_PATH) ./GIT-VERSION-GEN
|
||||
@@ -1214,6 +1216,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
|
||||
NO_INET_NTOP = YesPlease
|
||||
NO_POSIX_GOODIES = UnfortunatelyYes
|
||||
NO_D_INO_IN_DIRENT = YesPlease
|
||||
NO_UNIX_SOCKETS = UnfortunatelyNot
|
||||
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/win32
|
||||
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
|
||||
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
|
||||
@@ -1624,6 +1627,9 @@ endif
|
||||
ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
|
||||
export GIT_TEST_CMP_USE_COPIED_CONTEXT
|
||||
endif
|
||||
ifdef NO_UNIX_SOCKETS
|
||||
COMPAT_CFLAGS += -DNO_UNIX_SOCKETS=1
|
||||
endif
|
||||
|
||||
ifeq ($(TCLTK_PATH),)
|
||||
NO_TCLTK=NoThanks
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
#include "cache.h"
|
||||
#include "unix-socket.h"
|
||||
|
||||
#ifdef NO_UNIX_SOCKETS
|
||||
int unix_stream_connect(const char *path)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int unix_stream_listen(const char *path)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
static int unix_stream_socket(void)
|
||||
{
|
||||
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
@@ -56,3 +69,4 @@ int unix_stream_listen(const char *path)
|
||||
|
||||
return fd;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user