Skip to content

Commit 59c7b88

Browse files
jeffhostetlergitster
authored andcommitted
simple-ipc: add win32 implementation
Create Windows implementation of "simple-ipc" using named pipes. Signed-off-by: Jeff Hostetler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 066d523 commit 59c7b88

File tree

6 files changed

+1018
-0
lines changed

6 files changed

+1018
-0
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,11 @@ else
16791679
LIB_OBJS += unix-socket.o
16801680
endif
16811681

1682+
ifdef USE_WIN32_IPC
1683+
LIB_OBJS += compat/simple-ipc/ipc-shared.o
1684+
LIB_OBJS += compat/simple-ipc/ipc-win32.o
1685+
endif
1686+
16821687
ifdef NO_ICONV
16831688
BASIC_CFLAGS += -DNO_ICONV
16841689
endif

compat/simple-ipc/ipc-shared.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "cache.h"
2+
#include "simple-ipc.h"
3+
#include "strbuf.h"
4+
#include "pkt-line.h"
5+
#include "thread-utils.h"
6+
7+
#ifdef SUPPORTS_SIMPLE_IPC
8+
9+
int ipc_server_run(const char *path, const struct ipc_server_opts *opts,
10+
ipc_server_application_cb *application_cb,
11+
void *application_data)
12+
{
13+
struct ipc_server_data *server_data = NULL;
14+
int ret;
15+
16+
ret = ipc_server_run_async(&server_data, path, opts,
17+
application_cb, application_data);
18+
if (ret)
19+
return ret;
20+
21+
ret = ipc_server_await(server_data);
22+
23+
ipc_server_free(server_data);
24+
25+
return ret;
26+
}
27+
28+
#endif /* SUPPORTS_SIMPLE_IPC */

0 commit comments

Comments
 (0)