Remove duplicate version/copyright info
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 25 Sep 2012 19:59:57 +0000 (20:59 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 25 Sep 2012 19:59:57 +0000 (20:59 +0100)
Print compilation flags at DEBUG >= 3 (this is actually useful if you're using a package version)

src/main/radiusd.c
src/main/version.c

index 5a890c1..9db0cfa 100644 (file)
@@ -218,9 +218,14 @@ int main(int argc, char *argv[])
                                break;
 
                        case 'v':
+                               /* Don't print timestamps */
+                               debug_flag += 2;
+                               fr_log_fp = stdout;
+                               mainconfig.radlog_dest = RADLOG_STDOUT;
+                               mainconfig.radlog_fd = STDOUT_FILENO;
+                               
                                version();
-                               break;
-
+                               exit(0);
                        case 'X':
                                spawn_flag = FALSE;
                                dont_fork = TRUE;
@@ -249,15 +254,8 @@ int main(int argc, char *argv[])
                exit(1);
        }
 
-       if (debug_flag) {
-               radlog(L_INFO, "%s", radiusd_version);
-               radlog(L_INFO, "Copyright (C) 1999-2012 The FreeRADIUS server project and contributors.\n");
-               radlog(L_INFO, "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n");
-               radlog(L_INFO, "PARTICULAR PURPOSE.\n");
-               radlog(L_INFO, "You may redistribute copies of FreeRADIUS under the terms of the\n");
-               radlog(L_INFO, "GNU General Public License v2.\n");
-               fflush(NULL);
-       }
+       if (debug_flag)
+               version();
 
        /*  Read the configuration files, BEFORE doing anything else.  */
        if (read_mainconfig(0) < 0) {
index b55192c..ebb0fb3 100644 (file)
@@ -30,58 +30,56 @@ RCSID("$Id$")
 /*
  *     Display the revision number for this program
  */
-void NEVER_RETURNS version(void)
+void version(void)
 {
 
-       printf("%s: %s\n", progname, radiusd_version);
-#if 0
-       printf("Compilation flags: ");
+       radlog(L_INFO, "%s: %s", progname, radiusd_version);
+       DEBUG3("Compilation flags: ");
 
        /* here are all the conditional feature flags */
 #if defined(WITH_DHCP)
-       printf(" WITH_DHCP");
+       DEBUG3(" WITH_DHCP");
 #endif
 #if defined(WITH_VMPS)
-       printf(" WITH_VMPS");
+       DEBUG3(" WITH_VMPS");
 #endif
 #if defined(OSFC2)
-       printf(" OSFC2");
+       DEBUG3(" OSFC2");
 #endif
 #if defined(WITHOUT_PROXY)
-       printf(" WITHOUT_PROXY");
+       DEBUG3(" WITHOUT_PROXY");
 #endif
 #if defined(WITHOUT_DETAIL)
-       printf(" WITHOUT_DETAIL");
+       DEBUG3(" WITHOUT_DETAIL");
 #endif
 #if defined(WITHOUT_SESSION_MGMT)
-       printf(" WITHOUT_SESSION_MGMT");
+       DEBUG3(" WITHOUT_SESSION_MGMT");
 #endif
 #if defined(WITHOUT_UNLANG)
-       printf(" WITHOUT_UNLANG");
+       DEBUG3(" WITHOUT_UNLANG");
 #endif
 #if defined(WITHOUT_ACCOUNTING)
-       printf(" WITHOUT_ACCOUNTING");
+       DEBUG3(" WITHOUT_ACCOUNTING");
 #endif
 #if defined(WITHOUT_DYNAMIC_CLIENTS)
-       printf(" WITHOUT_DYNAMIC_CLIENTS");
+       DEBUG3(" WITHOUT_DYNAMIC_CLIENTS");
 #endif
 #if defined(WITHOUT_STATS)
-       printf(" WITHOUT_STATS");
+       DEBUG3(" WITHOUT_STATS");
 #endif
 #if defined(WITHOUT_COMMAND_SOCKET)
-       printf(" WITHOUT_COMMAND_SOCKET");
+       DEBUG3(" WITHOUT_COMMAND_SOCKET");
 #endif
 #if defined(WITHOUT_COA)
-       printf(" WITHOUT_COA");
+       DEBUG3(" WITHOUT_COA");
 #endif
-       printf("\n");
-#endif
-       printf("Copyright (C) 1999-2011 The FreeRADIUS server project and contributors.\n");
-       printf("There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n");
-       printf("PARTICULAR PURPOSE.\n");
-       printf("You may redistribute copies of FreeRADIUS under the terms of the\n");
-       printf("GNU General Public License.\n");
-       printf("For more information about these matters, see the file named COPYRIGHT.\n");
-       exit (0);
+       radlog(L_INFO, "Copyright (C) 1999-2012 The FreeRADIUS server project and contributors.");
+       radlog(L_INFO, "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A");
+       radlog(L_INFO, "PARTICULAR PURPOSE.");
+       radlog(L_INFO, "You may redistribute copies of FreeRADIUS under the terms of the");
+       radlog(L_INFO, "GNU General Public License.");
+       radlog(L_INFO, "For more information about these matters, see the file named COPYRIGHT.");
+       
+       fflush(NULL);
 }