Skip to content

Commit

Permalink
Remove duplicate version/copyright info
Browse files Browse the repository at this point in the history
Print compilation flags at DEBUG >= 3 (this is actually useful if you're using a package version)
  • Loading branch information
arr2036 committed Sep 25, 2012
1 parent 6d48f6d commit 26c8b9b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 48 deletions.
20 changes: 9 additions & 11 deletions src/main/radiusd.c
Expand Up @@ -219,9 +219,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;
Expand Down Expand Up @@ -250,15 +255,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");
radlog(L_INFO, "\n");
}
if (debug_flag)
version();

/* Read the configuration files, BEFORE doing anything else. */
if (read_mainconfig(0) < 0) {
Expand Down
66 changes: 29 additions & 37 deletions src/main/version.c
Expand Up @@ -30,78 +30,70 @@ RCSID("$Id$")
/*
* Display the revision number for this program
*/
void NEVER_RETURNS version(void)
void version(void)
{

printf("%s: %s\n", progname, radiusd_version);

printf("Copyright (C) 1999-2012 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");

if (debug_flag) {
printf("\n");

printf("Functionality: ");
radlog(L_INFO, "%s: %s", progname, radiusd_version);
DEBUG3("Functionality: ");

#ifdef WITH_ACCOUNTING
printf("accounting, ");
DEBUG3(" accounting");
#endif
printf("authentication, "); /* always enabled */
DEBUG3(" authentication"); /* always enabled */

#ifdef WITH_COA
printf("coa, ");
DEBUG3(" coa");
#endif
#ifdef WITH_COMMAND_SOCKET
printf("control-socket, ");
DEBUG3(" control-socket");
#endif
#ifdef WITH_DETAIL
printf("detail, ");
DEBUG3(" detail");
#endif
#ifdef WITH_DHCP
printf("dhcp, ");
DEBUG3(" dhcp");
#endif
#ifdef WITH_DYNAMIC_CLIENTS
printf("dynamic clients, ");
DEBUG3(" dynamic clients");
#endif
#ifdef OSFC2
printf("OSFC2, ");
DEBUG3(" OSFC2");
#endif
#ifdef WITH_PROXY
printf("proxy, ");
DEBUG3(" proxy");
#endif
#ifdef HAVE_PCREPOSIX_H
printf("regex-PCRE, ");
DEBUG3(" regex-PCRE");
#else
#ifdef HAVE_REGEX_H
printf("regex-posix, ");
DEBUG3(" regex-posix");
#endif
#endif

#ifdef WITH_SESSION_MGMT
printf("session-management, ");
DEBUG3(" session-management");
#endif
#ifdef WITH_STATS
printf("stats, ");
DEBUG3(" stats");
#endif
#ifdef WITH_TCP
printf("tcp, ");
DEBUG3(" tcp");
#endif
#ifdef WITH_TLS
printf("TLS, ");
DEBUG3(" TLS");
#endif
#ifdef WITH_UNLANG
printf("unlang, ");
DEBUG3(" unlang");
#endif
#ifdef WITH_VMPS
printf("vmps, ");
#endif
printf("\n");
}

exit (0);
DEBUG3(" vmps");
#endif
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);
}

0 comments on commit 26c8b9b

Please sign in to comment.