[Olsr-dev] [PATCH v1 20/23] quagga: clean up olsr_exit messages

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


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/quagga/src/client.c |  5 +++--
 lib/quagga/src/packet.c |  6 +++---
 lib/quagga/src/parse.c  | 12 ++++++------
 lib/quagga/src/quagga.c |  4 ++--
 4 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/lib/quagga/src/client.c b/lib/quagga/src/client.c
index dc7be84..383295b 100644
--- a/lib/quagga/src/client.c
+++ b/lib/quagga/src/client.c
@@ -60,11 +60,12 @@ zclient_connect(void)
   } sockaddr;
 
   if (close(zebra.sock) < 0)
-    olsr_exit("(QUAGGA) Could not close socket!", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Could not close socket", EXIT_FAILURE);
+
   zebra.sock = socket(zebra.port ? AF_INET : AF_UNIX, SOCK_STREAM, 0);
 
   if (zebra.sock < 0)
-    olsr_exit("(QUAGGA) Could not create socket!", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Could not create socket", EXIT_FAILURE);
 
   memset(&sockaddr, 0, sizeof sockaddr);
 
diff --git a/lib/quagga/src/packet.c b/lib/quagga/src/packet.c
index d684211..9786bb8 100644
--- a/lib/quagga/src/packet.c
+++ b/lib/quagga/src/packet.c
@@ -48,7 +48,7 @@ unsigned char
     t += sizeof cmd;
     break;
   default:
-    olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
     break;
   }
   *t++ = r->type;
@@ -64,7 +64,7 @@ unsigned char
     t += sizeof safi;
     break;
   default:
-    olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
     break;
   }
   *t++ = r->prefixlen;
@@ -131,7 +131,7 @@ unsigned char
     pnt += sizeof cmd;
     break;
   default:
-    olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
     break;
   }
   *pnt++ = type;
diff --git a/lib/quagga/src/parse.c b/lib/quagga/src/parse.c
index aa9c6c9..1389326 100644
--- a/lib/quagga/src/parse.c
+++ b/lib/quagga/src/parse.c
@@ -61,7 +61,7 @@ static struct zroute
     pnt = &opt[6];
     break;
   default:
-    olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
     break;
   }
   r->type = *pnt++;
@@ -105,7 +105,7 @@ static struct zroute
   case 2:
     break;
   default:
-    olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
     break;
   }
 
@@ -122,7 +122,7 @@ static struct zroute
   }
 
   if (pnt - opt != length) {
-    olsr_exit("(QUAGGA) Length does not match!", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Length does not match", EXIT_FAILURE);
   }
 
   return r;
@@ -148,7 +148,7 @@ zparse(void *foo __attribute__ ((unused)))
       memcpy(&length, f, sizeof length);
       length = ntohs (length);
       if (!length) // something weired happened
-        olsr_exit("(QUAGGA) Zero message length!", EXIT_FAILURE);
+        olsr_exit("QUAGGA: Zero message length", EXIT_FAILURE);
       command = f[2];
       switch (zebra.version) {
       case 0:
@@ -156,12 +156,12 @@ zparse(void *foo __attribute__ ((unused)))
       case 1:
       case 2:
         if ((f[2] != ZEBRA_HEADER_MARKER) || (f[3] != zebra.version))
-          olsr_exit("(QUAGGA) Invalid zebra header received!", EXIT_FAILURE);
+          olsr_exit("QUAGGA: Invalid zebra header received", EXIT_FAILURE);
         memcpy(&command, &f[4], sizeof command);
         command = ntohs (command);
         break;
       default:
-        olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
+        olsr_exit("QUAGGA: Unsupported zebra packet version", EXIT_FAILURE);
         break;
       }
       if (olsr_cnf->ip_version == AF_INET) {
diff --git a/lib/quagga/src/quagga.c b/lib/quagga/src/quagga.c
index d658cdb..50145dd 100644
--- a/lib/quagga/src/quagga.c
+++ b/lib/quagga/src/quagga.c
@@ -171,7 +171,7 @@ zebra_redistribute(uint16_t cmd)
   for (type = 0; type < ZEBRA_ROUTE_MAX; type++)
     if (zebra.redistribute[type]) {
       if (zclient_write(zpacket_redistribute(cmd, type)) < 0)
-        olsr_exit("(QUAGGA) Could not write redistribute packet!", EXIT_FAILURE);
+        olsr_exit("QUAGGA: Could not write redistribute packet", EXIT_FAILURE);
     }
 
 }
@@ -181,7 +181,7 @@ zebra_hello(uint16_t cmd)
 {
 
   if (zclient_write(zpacket_redistribute(cmd, ZEBRA_ROUTE_OLSR)) < 0)
-    olsr_exit("(QUAGGA) Could not write hello packet!", EXIT_FAILURE);
+    olsr_exit("QUAGGA: Could not write hello packet", EXIT_FAILURE);
 
 }
 
-- 
2.5.0




More information about the Olsr-dev mailing list