From 6785ca65ab48f1a29914c1784a24009964ec4720 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 9 Feb 2017 16:49:56 +0100 Subject: ipcpd, lib: Report IPCP creation failure The IPCP will now respond with an ipcp_create_r message when it fails, informing the IRMd. Also adds some const qualifiers in the public headers and fixes some formatting in dev.c. --- src/ipcpd/local/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ipcpd/local') diff --git a/src/ipcpd/local/main.c b/src/ipcpd/local/main.c index b49e1612..ccbd6acb 100644 --- a/src/ipcpd/local/main.c +++ b/src/ipcpd/local/main.c @@ -353,11 +353,13 @@ int main(int argc, if (ipcp_init(argc, argv, THIS_TYPE, &local_ops) < 0) { log_err("Failed to init IPCP."); + ipcp_create_r(getpid(), -1); exit(EXIT_FAILURE); } if (local_data_init() < 0) { log_err("Failed to init local data."); + ipcp_create_r(getpid(), -1); ipcp_fini(); exit(EXIT_FAILURE); } @@ -366,6 +368,7 @@ int main(int argc, if (ipcp_boot() < 0) { log_err("Failed to boot IPCP."); + ipcp_create_r(getpid(), -1); local_data_fini(); ipcp_fini(); exit(EXIT_FAILURE); @@ -373,7 +376,7 @@ int main(int argc, pthread_sigmask(SIG_UNBLOCK, &sigset, NULL); - if (ipcp_create_r(getpid())) { + if (ipcp_create_r(getpid(), 0)) { log_err("Failed to notify IRMd we are initialized."); ipcp_set_state(IPCP_NULL); ipcp_shutdown(); -- cgit v1.2.3