blob: e5e1dda8ccdb60320a05b064479595eb4eb4997c [file] [log] [blame]
Elijah Newren4f6728d2023-03-21 06:25:56 +00001#include "git-compat-util.h"
Jeff Hostetler59c7b882021-03-15 21:08:23 +00002#include "simple-ipc.h"
3#include "strbuf.h"
4#include "pkt-line.h"
5#include "thread-utils.h"
6
Jeff Hostetler6aac70a2021-05-20 18:28:10 +00007#ifndef SUPPORTS_SIMPLE_IPC
8/*
9 * This source file should only be compiled when Simple IPC is supported.
10 * See the top-level Makefile.
11 */
12#error SUPPORTS_SIMPLE_IPC not defined
13#endif
Jeff Hostetler59c7b882021-03-15 21:08:23 +000014
15int ipc_server_run(const char *path, const struct ipc_server_opts *opts,
16 ipc_server_application_cb *application_cb,
17 void *application_data)
18{
19 struct ipc_server_data *server_data = NULL;
20 int ret;
21
22 ret = ipc_server_run_async(&server_data, path, opts,
23 application_cb, application_data);
24 if (ret)
25 return ret;
26
27 ret = ipc_server_await(server_data);
28
29 ipc_server_free(server_data);
30
31 return ret;
32}