[Olsr-dev] [PATCH v1 13/23] build_msg: clean up invocation of olsr_exit
Ferry Huberts
(spam-protected)
Fri Nov 6 16:29:05 CET 2015
From: Ferry Huberts <(spam-protected)>
olsr_exit already logs to the syslog and also prints
the message
Signed-off-by: Ferry Huberts <(spam-protected)>
---
src/build_msg.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/build_msg.c b/src/build_msg.c
index 281148b..fe2cecb 100644
--- a/src/build_msg.c
+++ b/src/build_msg.c
@@ -231,9 +231,9 @@ static void
check_buffspace(int msgsize, int buffsize, const char *type)
{
if (msgsize > buffsize) {
- OLSR_PRINTF(1, "%s build, outputbuffer to small(%d/%u)!\n", type, msgsize, buffsize);
- olsr_syslog(OLSR_LOG_ERR, "%s build, outputbuffer to small(%d/%u)!\n", type, msgsize, buffsize);
- olsr_exit(__func__, EXIT_FAILURE);
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "%s: %s build, output buffer too small (%d/%u)", __func__, type, msgsize, buffsize);
+ olsr_exit(buf, EXIT_FAILURE);
}
}
--
2.5.0
More information about the Olsr-dev
mailing list