martin 02/01/25 09:25:14
Modified: src/main http_main.c
Log:
No need to call time(NULL) twice
Revision Changes Path
1.573 +7 -6 apache-1.3/src/main/http_main.c
Index: http_main.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
retrieving revision 1.572
retrieving revision 1.573
diff -u -r1.572 -r1.573
--- http_main.c 20 Jan 2002 22:45:14 -0000 1.572
+++ http_main.c 25 Jan 2002 17:25:14 -0000 1.573
@@ -1504,7 +1504,7 @@
if (!current_conn->keptalive) {
/* in some cases we come here before setting the time */
if (log_req->request_time == 0) {
- log_req->request_time = time(0);
+ log_req->request_time = time(NULL);
}
ap_log_transaction(log_req);
}
@@ -1587,20 +1587,21 @@
unsigned int old;
#if defined(WIN32) || defined(NETWARE)
+ time_t now = time(NULL);
#ifdef NETWARE
get_tsd
#endif
old = alarm_expiry_time;
if (old)
- old -= time(0);
+ old -= now;
if (x == 0) {
alarm_fn = NULL;
alarm_expiry_time = 0;
}
else {
alarm_fn = fn;
- alarm_expiry_time = time(NULL) + x;
+ alarm_expiry_time = now + x;
}
#else
if (alarm_fn && x && fn != alarm_fn) {
@@ -4742,7 +4743,7 @@
static void startup_children(int number_to_start)
{
int i;
- time_t now = time(0);
+ time_t now = time(NULL);
for (i = 0; number_to_start && i < ap_daemons_limit; ++i) {
if (ap_scoreboard_image->servers[i].status != SERVER_DEAD) {
@@ -4788,7 +4789,7 @@
int to_kill;
int idle_count;
short_score *ss;
- time_t now = time(0);
+ time_t now = time(NULL);
int free_length;
int free_slots[MAX_SPAWN_RATE];
int last_non_dead;
@@ -5099,7 +5100,7 @@
/* we're still doing a 1-for-1 replacement of dead
* children with new children
*/
- make_child(server_conf, child_slot, time(0));
+ make_child(server_conf, child_slot, time(NULL));
--remaining_children_to_start;
}
#ifndef NO_OTHER_CHILD
|