[svn-commits] mjordan: branch 1.8 r395032 - /branches/1.8/main/asterisk.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jul 22 08:49:03 CDT 2013


Author: mjordan
Date: Mon Jul 22 08:49:00 2013
New Revision: 395032

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395032
Log:
Update copyright year to 2013 in asterisk.c; some whitespace fixes

(closes issue ASTERISK-22179)
Reported by: Malcolm Davenport

Modified:
    branches/1.8/main/asterisk.c

Modified: branches/1.8/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/asterisk.c?view=diff&rev=395032&r1=395031&r2=395032
==============================================================================
--- branches/1.8/main/asterisk.c (original)
+++ branches/1.8/main/asterisk.c Mon Jul 22 08:49:00 2013
@@ -1,7 +1,7 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 1999 - 2012, Digium, Inc.
+ * Copyright (C) 1999 - 2013, Digium, Inc.
  *
  * Mark Spencer <markster at digium.com>
  *
@@ -23,23 +23,23 @@
  *
  * \par Developer Documentation for Asterisk
  *
- * This is the main developer documentation for Asterisk. It is 
- * generated by running "make progdocs" from the Asterisk source tree.  
+ * This is the main developer documentation for Asterisk. It is
+ * generated by running "make progdocs" from the Asterisk source tree.
  *
- * In addition to the information available on the Asterisk source code, 
- * please see the appendices for information on coding guidelines, 
+ * In addition to the information available on the Asterisk source code,
+ * please see the appendices for information on coding guidelines,
  * release management, commit policies, and more.
  *
  * \arg \ref AsteriskArchitecture
  *
  * \par Additional documentation
  * \arg \ref Licensing
- * \arg \ref DevDoc 
+ * \arg \ref DevDoc
  * \arg \ref ConfigFiles
  *
  * \section copyright Copyright and Author
  *
- * Copyright (C) 1999 - 2012, Digium, Inc.
+ * Copyright (C) 1999 - 2013, Digium, Inc.
  * Asterisk is a <a href="http://www.digium.com/en/company/view-policy.php?id=Trademark-Policy">registered trademark</a>
  * of <a href="http://www.digium.com">Digium, Inc</a>.
  *
@@ -56,7 +56,7 @@
 /*! \file
   \brief Top level source file for Asterisk  - the Open Source PBX. Implementation
   of PBX core functions and CLI interface.
-  
+
  */
 
 /*** MODULEINFO
@@ -160,7 +160,7 @@
 
 /*! \brief Welcome message when starting a CLI interface */
 #define WELCOME_MESSAGE \
-    ast_verbose("Asterisk %s, Copyright (C) 1999 - 2012 Digium, Inc. and others.\n" \
+    ast_verbose("Asterisk %s, Copyright (C) 1999 - 2013 Digium, Inc. and others.\n" \
                 "Created by Mark Spencer <markster at digium.com>\n" \
                 "Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.\n" \
                 "This is free software, with components licensed under the GNU General Public\n" \
@@ -171,7 +171,7 @@
 /*! \defgroup main_options Main Configuration Options
  * \brief Main configuration options from asterisk.conf or OS command line on starting Asterisk.
  * \arg \ref Config_ast "asterisk.conf"
- * \note Some of them can be changed in the CLI 
+ * \note Some of them can be changed in the CLI
  */
 /*! @{ */
 
@@ -323,7 +323,7 @@
 	work = ast_strdupa(version);
 	work = ast_strip(ast_strip_quoted(work, "$", "$"));
 	version_length = strlen(work) + 1;
-	
+
 	if (!(new = ast_calloc(1, sizeof(*new) + version_length)))
 		return;
 
@@ -385,8 +385,8 @@
 	if (iterator)
 		return iterator->version;
 	return NULL;
-}      
-       
+}
+
 
 
 struct thread_list_t {
@@ -398,7 +398,7 @@
 static AST_RWLIST_HEAD_STATIC(thread_list, thread_list_t);
 
 void ast_register_thread(char *name)
-{ 
+{
 	struct thread_list_t *new = ast_calloc(1, sizeof(*new));
 
 	if (!new)
@@ -459,7 +459,7 @@
 	else
 		ast_cli(a->fd, "  Maximum calls:               Not set\n");
 	if (option_maxfiles)
-		ast_cli(a->fd, "  Maximum open file handles:   %d\n", option_maxfiles); 
+		ast_cli(a->fd, "  Maximum open file handles:   %d\n", option_maxfiles);
 	else
 		ast_cli(a->fd, "  Maximum open file handles:   Not set\n");
 	ast_cli(a->fd, "  Verbosity:                   %d\n", option_verbose);
@@ -522,7 +522,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show threads";
-		e->usage = 
+		e->usage =
 			"Usage: core show threads\n"
 			"       List threads currently active in the system.\n";
 		return NULL;
@@ -754,7 +754,7 @@
 #elif defined(linux)
 static __inline uint64_t
 rdtsc(void)
-{ 
+{
 	uint64_t rv;
 
 	__asm __volatile(".byte 0x0f, 0x31" : "=A" (rv));
@@ -877,7 +877,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show file version [like]";
-		e->usage = 
+		e->usage =
 			"Usage: core show file version [like <pattern>]\n"
 			"       Lists the revision numbers of the files used to build this copy of Asterisk.\n"
 			"       Optional regular expression pattern is used to filter the file list.\n";
@@ -1074,7 +1074,7 @@
 	pid = fork();
 #else
 	pid = vfork();
-#endif	
+#endif
 
 	if (pid == 0) {
 #ifdef HAVE_CAP
@@ -1100,7 +1100,7 @@
 			if (res > -1) {
 				res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
 				break;
-			} else if (errno != EINTR) 
+			} else if (errno != EINTR)
 				break;
 		}
 	} else {
@@ -1172,7 +1172,7 @@
 		if (consoles[x].mute)
 			continue;
 		if (consoles[x].fd > -1) {
-			if (!consoles[x].levels[level]) 
+			if (!consoles[x].levels[level])
 				fdprint(consoles[x].p[1], string);
 		}
 	}
@@ -1196,7 +1196,7 @@
 {
 	int x;
 	for (x = 0; x < AST_MAX_CONNECTS; x++) {
-		if (consoles[x].fd > -1) 
+		if (consoles[x].fd > -1)
 			fdprint(consoles[x].p[1], string);
 	}
 }
@@ -1362,7 +1362,7 @@
 	close(con->p[0]);
 	close(con->p[1]);
 	con->fd = -1;
-	
+
 	return NULL;
 }
 
@@ -1451,14 +1451,14 @@
 	uid_t uid = -1;
 	gid_t gid = -1;
 
-	for (x = 0; x < AST_MAX_CONNECTS; x++)	
+	for (x = 0; x < AST_MAX_CONNECTS; x++)
 		consoles[x].fd = -1;
 	unlink(ast_config_AST_SOCKET);
 	ast_socket = socket(PF_LOCAL, SOCK_STREAM, 0);
 	if (ast_socket < 0) {
 		ast_log(LOG_WARNING, "Unable to create control socket: %s\n", strerror(errno));
 		return -1;
-	}		
+	}
 	memset(&sunaddr, 0, sizeof(sunaddr));
 	sunaddr.sun_family = AF_LOCAL;
 	ast_copy_string(sunaddr.sun_path, ast_config_AST_SOCKET, sizeof(sunaddr.sun_path));
@@ -1493,7 +1493,7 @@
 		else
 			uid = pw->pw_uid;
 	}
-		
+
 	if (!ast_strlen_zero(ast_config_AST_CTL_GROUP)) {
 		struct group *grp;
 		if ((grp = getgrnam(ast_config_AST_CTL_GROUP)) == NULL)
@@ -1541,8 +1541,8 @@
 /*! \brief Urgent handler
 
  Called by soft_hangup to interrupt the poll, read, or other
- system call.  We don't actually need to do anything though.  
- Remember: Cannot EVER ast_log from within a signal handler 
+ system call.  We don't actually need to do anything though.
+ Remember: Cannot EVER ast_log from within a signal handler
  */
 static void _urg_handler(int num)
 {
@@ -1557,7 +1557,7 @@
 static void _hup_handler(int num)
 {
 	int a = 0, save_errno = errno;
-	if (option_verbose > 1) 
+	if (option_verbose > 1)
 		printf("Received HUP signal -- Reloading configs\n");
 	if (restartnow)
 		execvp(_argv[0], _argv);
@@ -1585,7 +1585,7 @@
 	 */
 	for (n = 0; wait4(-1, &status, WNOHANG, NULL) > 0; n++)
 		;
-	if (n == 0 && option_debug)	
+	if (n == 0 && option_debug)
 		printf("Huh?  Child handler, but nobody there?\n");
 	errno = save_errno;
 }
@@ -1599,22 +1599,22 @@
 static void set_ulimit(int value)
 {
 	struct rlimit l = {0, 0};
-	
+
 	if (value <= 0) {
 		ast_log(LOG_WARNING, "Unable to change max files open to invalid value %i\n",value);
 		return;
 	}
-	
+
 	l.rlim_cur = value;
 	l.rlim_max = value;
-	
+
 	if (setrlimit(RLIMIT_NOFILE, &l)) {
 		ast_log(LOG_WARNING, "Unable to disable core size resource limit: %s\n",strerror(errno));
 		return;
 	}
-	
+
 	ast_log(LOG_NOTICE, "Setting max files open to %d\n",value);
-	
+
 	return;
 }
 
@@ -1638,7 +1638,7 @@
 	struct sched_param sched;
 	memset(&sched, 0, sizeof(sched));
 #ifdef __linux__
-	if (pri) {  
+	if (pri) {
 		sched.sched_priority = 10;
 		if (sched_setscheduler(0, SCHED_RR, &sched)) {
 			ast_log(LOG_WARNING, "Unable to set high priority\n");
@@ -1822,7 +1822,7 @@
 		close_logger();
 		clean_time_zones();
 
-		/* If there is a consolethread running send it a SIGHUP 
+		/* If there is a consolethread running send it a SIGHUP
 		   so it can execvp, otherwise we can do it ourselves */
 		if ((consolethread != AST_PTHREADT_NULL) && (consolethread != pthread_self())) {
 			pthread_kill(consolethread, SIGHUP);
@@ -1830,7 +1830,7 @@
 			sleep(2);
 		} else
 			execvp(_argv[0], _argv);
-	
+
 	} else {
 		/* close logger */
 		close_logger();
@@ -1894,7 +1894,7 @@
 	}
 
 	fflush(stdout);
-	
+
 	/* Wake up a poll()ing console */
 	if (ast_opt_console && consolethread != AST_PTHREADT_NULL)
 		pthread_kill(consolethread, SIGURG);
@@ -1905,7 +1905,7 @@
 	while (*s) {
 		if (*s > 32)
 			return 0;
-		s++;  
+		s++;
 	}
 	return 1;
 }
@@ -1924,7 +1924,7 @@
 			ast_safe_system(s+1);
 		else
 			ast_safe_system(getenv("SHELL") ? getenv("SHELL") : "/bin/sh");
-	} else 
+	} else
 		ast_cli_command(STDOUT_FILENO, s);
 }
 
@@ -1957,7 +1957,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show version";
-		e->usage = 
+		e->usage =
 			"Usage: core show version\n"
 			"       Shows Asterisk version information.\n";
 		return NULL;
@@ -1988,7 +1988,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core stop now";
-		e->usage = 
+		e->usage =
 			"Usage: core stop now\n"
 			"       Shuts down a running Asterisk immediately, hanging up all active calls .\n";
 		return NULL;
@@ -2007,7 +2007,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core stop gracefully";
-		e->usage = 
+		e->usage =
 			"Usage: core stop gracefully\n"
 			"       Causes Asterisk to not accept new calls, and exit when all\n"
 			"       active calls have terminated normally.\n";
@@ -2027,7 +2027,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core stop when convenient";
-		e->usage = 
+		e->usage =
 			"Usage: core stop when convenient\n"
 			"       Causes Asterisk to perform a shutdown when all active calls have ended.\n";
 		return NULL;
@@ -2047,7 +2047,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core restart now";
-		e->usage = 
+		e->usage =
 			"Usage: core restart now\n"
 			"       Causes Asterisk to hangup all calls and exec() itself performing a cold\n"
 			"       restart.\n";
@@ -2067,7 +2067,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core restart gracefully";
-		e->usage = 
+		e->usage =
 			"Usage: core restart gracefully\n"
 			"       Causes Asterisk to stop accepting new calls and exec() itself performing a cold\n"
 			"       restart when all active calls have ended.\n";
@@ -2087,7 +2087,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core restart when convenient";
-		e->usage = 
+		e->usage =
 			"Usage: core restart when convenient\n"
 			"       Causes Asterisk to perform a cold restart when all active calls have ended.\n";
 		return NULL;
@@ -2109,7 +2109,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core abort shutdown";
-		e->usage = 
+		e->usage =
 			"Usage: core abort shutdown\n"
 			"       Causes Asterisk to abort an executing shutdown or restart, and resume normal\n"
 			"       call operations.\n";
@@ -2139,7 +2139,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "!";
-		e->usage = 
+		e->usage =
 			"Usage: !<command>\n"
 			"       Executes a given shell command\n";
 		return NULL;
@@ -2179,7 +2179,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show warranty";
-		e->usage = 
+		e->usage =
 			"Usage: core show warranty\n"
 			"       Shows the warranty (if any) for this copy of Asterisk.\n";
 		return NULL;
@@ -2216,7 +2216,7 @@
 	switch (cmd) {
 	case CLI_INIT:
 		e->command = "core show license";
-		e->usage = 
+		e->usage =
 			"Usage: core show license\n"
 			"       Shows the license(s) for this copy of Asterisk.\n";
 		return NULL;
@@ -2245,7 +2245,7 @@
 	AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
 	AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
 	AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
-	AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"), 
+	AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"),
 	AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
 	AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
 };
@@ -2301,7 +2301,7 @@
 			num_read = read(STDIN_FILENO, cp, 1);
 			if (num_read < 1) {
 				break;
-			} else 
+			} else
 				return (num_read);
 		}
 		if (fds[0].revents) {
@@ -2323,7 +2323,7 @@
 							WELCOME_MESSAGE;
 							if (!ast_opt_mute)
 								fdsend(ast_consock, "logger mute silent");
-							else 
+							else
 								printf("log and verbose output currently muted ('logger mute' to unmute)\n");
 							break;
 						} else
@@ -2493,7 +2493,7 @@
 		ast_str_set(&prompt, 0, "%s", ASTERISK_PROMPT);
 	}
 
-	return ast_str_buffer(prompt);	
+	return ast_str_buffer(prompt);
 }
 
 static char **ast_el_strtoarr(char *buf)
@@ -2625,7 +2625,7 @@
 	len = lf->cursor - ptr;
 
 	if (ast_opt_remote) {
-		snprintf(buf, sizeof(buf), "_COMMAND NUMMATCHES \"%s\" \"%s\"", lf->buffer, ptr); 
+		snprintf(buf, sizeof(buf), "_COMMAND NUMMATCHES \"%s\" \"%s\"", lf->buffer, ptr);
 		fdsend(ast_consock, buf);
 		if ((res = read(ast_consock, buf, sizeof(buf) - 1)) < 0) {
 			return (char*)(CC_ERROR);
@@ -2636,19 +2636,19 @@
 		if (nummatches > 0) {
 			char *mbuf;
 			int mlen = 0, maxmbuf = 2048;
-			/* Start with a 2048 byte buffer */			
+			/* Start with a 2048 byte buffer */
 			if (!(mbuf = ast_malloc(maxmbuf))) {
 				lf->cursor[0] = savechr;
 				return (char *)(CC_ERROR);
 			}
-			snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr); 
+			snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
 			fdsend(ast_consock, buf);
 			res = 0;
 			mbuf[0] = '\0';
 			while (!strstr(mbuf, AST_CLI_COMPLETE_EOF) && res != -1) {
 				if (mlen + 1024 > maxmbuf) {
 					/* Every step increment buffer 1024 bytes */
-					maxmbuf += 1024;					
+					maxmbuf += 1024;
 					if (!(mbuf = ast_realloc(mbuf, maxmbuf))) {
 						lf->cursor[0] = savechr;
 						return (char *)(CC_ERROR);
@@ -2702,7 +2702,7 @@
 				fprintf(stdout, "\n");
 				ast_cli_display_match_list(matches, nummatches, maxlen);
 				retval = CC_REDISPLAY;
-			} else { 
+			} else {
 				el_insertstr(editline," ");
 				retval = CC_REFRESH;
 			}
@@ -2730,8 +2730,8 @@
 	el = el_init("asterisk", stdin, stdout, stderr);
 	el_set(el, EL_PROMPT, cli_prompt);
 
-	el_set(el, EL_EDITMODE, 1);		
-	el_set(el, EL_EDITOR, editor ? editor : "emacs");		
+	el_set(el, EL_EDITMODE, 1);
+	el_set(el, EL_EDITOR, editor ? editor : "emacs");
 	el_hist = history_init();
 	if (!el || !el_hist)
 		return -1;
@@ -2856,7 +2856,7 @@
 		fdsend(ast_consock, tmp);
 		if (!ast_opt_mute)
 			fdsend(ast_consock, "logger mute silent");
-		else 
+		else
 			printf("log and verbose output currently muted ('logger mute' to unmute)\n");
 	}
 
@@ -2904,7 +2904,7 @@
 
 	ast_verbose("Connected to Asterisk %s currently running on %s (pid = %d)\n", version, hostname, pid);
 	remotehostname = hostname;
-	if (getenv("HOME")) 
+	if (getenv("HOME"))
 		snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
 	if (el_hist == NULL || el == NULL)
 		ast_el_initialize();
@@ -2955,7 +2955,7 @@
 
 static int show_cli_help(void)
 {
-	printf("Asterisk %s, Copyright (C) 1999 - 2012, Digium, Inc. and others.\n", ast_get_version());
+	printf("Asterisk %s, Copyright (C) 1999 - 2013, Digium, Inc. and others.\n", ast_get_version());
 	printf("Usage: asterisk [OPTIONS]\n");
 	printf("Valid Options:\n");
 	printf("   -V              Display version number and exit\n");
@@ -2993,7 +2993,7 @@
 	return 0;
 }
 
-static void ast_readconfig(void) 
+static void ast_readconfig(void)
 {
 	struct ast_config *cfg;
 	struct ast_variable *v;
@@ -3393,7 +3393,7 @@
 		ast_copy_string(hostname, "<Unknown>", sizeof(hostname));
 	ast_mainpid = getpid();
 
-	if (getenv("HOME")) 
+	if (getenv("HOME"))
 		snprintf(filename, sizeof(filename), "%s/.asterisk_history", getenv("HOME"));
 	/* Check for options */
 	while ((c = getopt(argc, argv, "BC:cde:FfG:ghIiL:M:mnpqRrs:TtU:VvWXx:")) != -1) {




More information about the svn-commits mailing list