[Olsr-dev] [PATCH v1 22/23] ipc_frontend: clean up olsr_exit messages

Ferry Huberts (spam-protected)
Fri Nov 6 16:29:14 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/ipc_frontend.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/ipc_frontend.c b/src/ipc_frontend.c
index b19b397..aae0e10 100644
--- a/src/ipc_frontend.c
+++ b/src/ipc_frontend.c
@@ -144,8 +144,9 @@ ipc_accept(int fd, void *data __attribute__ ((unused)), unsigned int flags __att
   addrlen = sizeof(struct sockaddr_in);
 
   if ((ipc_conn = accept(fd, (struct sockaddr *)&pin, &addrlen)) == -1) {
-    perror("IPC accept");
-    olsr_exit("IPC accept", EXIT_FAILURE);
+    char buf[1024];
+    snprintf(buf, sizeof(buf), "IPC accept error: %s", strerror(errno));
+    olsr_exit(buf, EXIT_FAILURE);
   } else {
     OLSR_PRINTF(1, "Front end connected\n");
     addr = inet_ntoa(pin.sin_addr);
-- 
2.5.0




More information about the Olsr-dev mailing list