[Olsr-dev] [PATCH v1 16/43] main: move printing of version into a function

Ferry Huberts (spam-protected)
Wed Nov 11 17:21:49 CET 2015


From: Ferry Huberts <(spam-protected)>

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

diff --git a/src/main.c b/src/main.c
index 627e53b..fc8a803 100644
--- a/src/main.c
+++ b/src/main.c
@@ -92,6 +92,7 @@ static void olsr_shutdown(int) __attribute__ ((noreturn));
  */
 void olsr_reconfigure(int signo) __attribute__ ((noreturn));
 
+static void print_version(void);
 static void print_usage(bool error);
 
 static int set_default_ifcnfs(struct olsr_if *, struct if_config_options *);
@@ -219,8 +220,7 @@ int main(int argc, char *argv[]) {
    * Start
    */
 
-  printf("\n *** %s ***\n Build date: %s on %s\n http://www.olsr.org\n\n",
-      olsrd_version, build_date, build_host);
+  print_version();
 
   if (argc == 2) {
     if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "/?") == 0)) {
@@ -816,6 +816,11 @@ static void olsr_shutdown(int signo __attribute__ ((unused)))
   exit(exit_value);
 }
 
+static void print_version(void) {
+  printf("\n *** %s ***\n Build date: %s on %s\n http://www.olsr.org\n\n",
+      olsrd_version, build_date, build_host);
+}
+
 /**
  * Print the command line usage
  */
-- 
2.5.0




More information about the Olsr-dev mailing list