max_tree_depth: lower it for MSVC to avoid stack overflows
[git.git] / compat / simple-ipc / ipc-shared.c
blobe5e1dda8ccdb60320a05b064479595eb4eb4997c
1 #include "git-compat-util.h"
2 #include "simple-ipc.h"
3 #include "strbuf.h"
4 #include "pkt-line.h"
5 #include "thread-utils.h"
7 #ifndef SUPPORTS_SIMPLE_IPC
8 /*
9 * This source file should only be compiled when Simple IPC is supported.
10 * See the top-level Makefile.
12 #error SUPPORTS_SIMPLE_IPC not defined
13 #endif
15 int ipc_server_run(const char *path, const struct ipc_server_opts *opts,
16 ipc_server_application_cb *application_cb,
17 void *application_data)
19 struct ipc_server_data *server_data = NULL;
20 int ret;
22 ret = ipc_server_run_async(&server_data, path, opts,
23 application_cb, application_data);
24 if (ret)
25 return ret;
27 ret = ipc_server_await(server_data);
29 ipc_server_free(server_data);
31 return ret;