parser: clean up invocation of olsr_exit
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 6 Nov 2015 15:06:53 +0000 (16:06 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 6 Nov 2015 15:26:23 +0000 (16:26 +0100)
olsr_exit already prints the message

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/parser.c

index 47e4907..0dd01d6 100644 (file)
@@ -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;