[asterisk-commits] trunk r29335 - /trunk/app.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun May 21 19:51:04 MST 2006


Author: rizzo
Date: Sun May 21 21:51:04 2006
New Revision: 29335

URL: http://svn.digium.com/view/asterisk?rev=29335&view=rev
Log:
use functional form of time()


Modified:
    trunk/app.c

Modified: trunk/app.c
URL: http://svn.digium.com/view/asterisk/trunk/app.c?rev=29335&r1=29334&r2=29335&view=diff
==============================================================================
--- trunk/app.c (original)
+++ trunk/app.c Sun May 21 21:51:04 2006
@@ -549,8 +549,7 @@
 		sfmt[fmtcnt++] = ast_strdupa(fmt);
 	}
 
-	time(&start);
-	end = start;  /* pre-initialize end to be same as start in case we never get into loop */
+	end = start = time(NULL);  /* pre-initialize end to be same as start in case we never get into loop */
 	for (x = 0; x < fmtcnt; x++) {
 		others[x] = ast_writefile(prepend ? prependfile : recordfile, sfmt[x], comment, O_TRUNC, 0, 0700);
 		if (option_verbose > 2)
@@ -670,7 +669,7 @@
 				}
 			}
 			if (maxtime) {
-				time(&end);
+				end = time(NULL);
 				if (maxtime < (end - start)) {
 					if (option_verbose > 2)
 						ast_verbose(VERBOSE_PREFIX_3 "Took too long, cutting it short...\n");
@@ -689,7 +688,8 @@
 		} else {
 			ast_frfree(f);
 		}
-		if (end == start) time(&end);
+		if (end == start)
+			end = time(NULL);
 	} else {
 		ast_log(LOG_WARNING, "Error creating writestream '%s', format '%s'\n", recordfile, sfmt[x]);
 	}
@@ -931,7 +931,7 @@
 	close(fd);
 
 	snprintf(s, strlen(path) + 9, "%s/.lock", path);
-	time(&start);
+	start = time(NULL);
 	while (((res = link(fs, s)) < 0) && (errno == EEXIST) && (time(NULL) - start < 5))
 		usleep(1);
 	if (res) {



More information about the asterisk-commits mailing list