Commit 8d5d1bcd authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

arch-wrs: define and create struct minipc_ch *hal_ch at startup

Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 04ef6eda
......@@ -30,6 +30,7 @@ CFLAGS += -Itime-unix
# mini-rpc directory contains minipc library
MINIPC_DIR := $A/mini-rpc
MINIPC_LIB := $(MINIPC_DIR)/libminipc.a
CFLAGS += -I$(MINIPC_DIR)
.PHONY: $(MINIPC_LIB)
$(MINIPC_LIB):
make -C $(MINIPC_DIR)
......
......@@ -15,6 +15,8 @@
#include <unistd.h>
#include <fcntl.h>
#include <minipc.h>
#include <hal_exports.h>
#include <ppsi/ppsi.h>
#include "ppsi-wrs.h"
......@@ -25,6 +27,8 @@ CONST_VERBOSITY int pp_diag_verbosity = 0;
#define MAX_LINKS 32
#define CONF_PATH "/etc/ppsi.conf"
struct minipc_ch *hal_ch;
int main(int argc, char **argv)
{
struct pp_globals *ppg;
......@@ -37,6 +41,10 @@ int main(int argc, char **argv)
setbuf(stdout, NULL);
hal_ch = minipc_client_create(WRSW_HAL_SERVER_ADDR, MINIPC_FLAG_VERBOSE);
if (!hal_ch) /* FIXME should we retry with minipc_client_create? */
pp_printf("Fatal: could not connect to HAL");
/* We are hosted, so we can allocate */
ppg = calloc(1, sizeof(*ppg));
if (!ppg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment