From 442c2b866e55545a0e21eaaf36b11621c8110411 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Thu, 7 Jul 2016 09:31:49 +0200 Subject: irmd, ipcps: Close logfile on exit IRMd and ipcps will now close the logfile upon exit. Also corrects exit(1) to exit(EXIT_FAILURE) and exit(0) to exit(EXIT_SUCCESS). --- src/ipcpd/shim-eth-llc/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/ipcpd/shim-eth-llc') diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 5e355bd7..4c260301 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -1247,7 +1247,7 @@ int main(int argc, char * argv[]) if (ipcp_parse_arg(argc, argv)) { LOG_ERR("Failed to parse arguments."); - exit(1); + exit(EXIT_FAILURE); } /* store the process id of the irmd */ @@ -1268,14 +1268,16 @@ int main(int argc, char * argv[]) _ipcp = ipcp_instance_create(); if (_ipcp == NULL) { LOG_ERR("Failed to create instance."); - exit(1); + close_logfile(); + exit(EXIT_FAILURE); } _ipcp->data = (struct ipcp_data *) eth_llc_ipcp_data_create(); if (_ipcp->data == NULL) { LOG_ERR("Failed to create instance data."); free(_ipcp); - exit(1); + close_logfile(); + exit(EXIT_FAILURE); } for (i = 0; i < AP_MAX_FLOWS; i++) { @@ -1304,5 +1306,7 @@ int main(int argc, char * argv[]) free(_ipcp); - exit(0); + close_logfile(); + + exit(EXIT_SUCCESS); } -- cgit v1.2.3