debian: new upstream point release
[git/debian.git] / compat / simple-ipc / ipc-shared.c
blobcb176d966f287d98e44495db1797061c8c1102af
1 #include "git-compat-util.h"
2 #include "simple-ipc.h"
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
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)
16 struct ipc_server_data *server_data = NULL;
17 int ret;
19 ret = ipc_server_run_async(&server_data, path, opts,
20 application_cb, application_data);
21 if (ret)
22 return ret;
24 ret = ipc_server_await(server_data);
26 ipc_server_free(server_data);
28 return ret;