[Olsr-dev] [PATCH v1 19/23] parser: clean up invocation of olsr_exit
Ferry Huberts
(spam-protected)
Fri Nov 6 16:29:11 CET 2015
From: Ferry Huberts <(spam-protected)>
olsr_exit already prints the message
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/parser.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/parser.c b/src/parser.c
index 47e4907..0dd01d6 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -535,8 +535,9 @@ olsr_input_hostemu(int fd, void *data __attribute__ ((unused)), unsigned int fla
/* Extract size */
if ((cc = recv(fd, (void *)&pcklen, 2, MSG_PEEK)) != 2) { /* Win needs a cast */
if (cc <= 0) {
- fprintf(stderr, "Lost olsr_switch connection - exit!\n");
- olsr_exit(__func__, EXIT_FAILURE);
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "%s: Lost olsr_switch connection", __func__);
+ olsr_exit(buf, EXIT_FAILURE);
}
fprintf(stderr, "[hust-emu] error extracting size(%d) %s!\n", cc, strerror(errno));
return;
--
2.5.0
More information about the Olsr-dev
mailing list