Raw
1 #include "git-compat-util.h"
2 #include "simple-ipc.h"
3
4 #ifndef SUPPORTS_SIMPLE_IPC
5 /*
6 * This source file should only be compiled when Simple IPC is supported.
7 * See the top-level Makefile.
8 */
9 #error SUPPORTS_SIMPLE_IPC not defined
10 #endif
11
12 int ipc_server_run(const char *path, const struct ipc_server_opts *opts,
13 ipc_server_application_cb *application_cb,
14 void *application_data)
15 {
16 struct ipc_server_data *server_data = NULL;
17 int ret;
18
19 ret = ipc_server_init_async(&server_data, path, opts,
20 application_cb, application_data);
21 if (ret)
22 return ret;
23
24 ipc_server_start_async(server_data);
25 ret = ipc_server_await(server_data);
26
27 ipc_server_free(server_data);
28
29 return ret;
30 }