summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-udp/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/shim-udp/main.c')
-rw-r--r--src/ipcpd/shim-udp/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ipcpd/shim-udp/main.c b/src/ipcpd/shim-udp/main.c
index 92204970..ddf4e80e 100644
--- a/src/ipcpd/shim-udp/main.c
+++ b/src/ipcpd/shim-udp/main.c
@@ -1569,11 +1569,13 @@ int main(int argc, char * argv[])
if (ipcp_parse_arg(argc, argv)) {
LOG_ERR("Failed to parse arguments.");
- exit(1);
+ exit(EXIT_FAILURE);
}
- if (shim_ap_init() < 0)
- exit(1);
+ if (shim_ap_init() < 0) {
+ close_logfile();
+ exit(EXIT_FAILURE);
+ }
/* store the process id of the irmd */
irmd_api = atoi(argv[1]);
@@ -1592,8 +1594,9 @@ int main(int argc, char * argv[])
_ipcp = ipcp_udp_create();
if (_ipcp == NULL) {
- LOG_ERR("Won't.");
- exit(1);
+ LOG_ERR("Failed to create IPCP.");
+ close_logfile();
+ exit(EXIT_FAILURE);
}
pthread_rwlock_wrlock(&_ipcp->state_lock);
@@ -1614,6 +1617,8 @@ int main(int argc, char * argv[])
free(_ipcp->ops);
free(_ipcp);
+ close_logfile();
+
exit(EXIT_SUCCESS);
}