comparison src/core/ngx_times.c @ 1081:4cf9d9b644f7

fix segfault if nginx was build with -O2 -fomit-frame-pointer (at least by gcc 4.0.2 and 4.0.3)
author Igor Sysoev <igor@sysoev.ru>
date Thu, 25 Jan 2007 22:01:23 +0000
parents 1b8111df8051
children a62d30719ea1
comparison
equal deleted inserted replaced
1080:681e048981a6 1081:4cf9d9b644f7
99 tp->msec = msec; 99 tp->msec = msec;
100 100
101 ngx_gmtime(sec, &gmt); 101 ngx_gmtime(sec, &gmt);
102 102
103 103
104 p0 = cached_http_time[slot]; 104 p0 = &cached_http_time[slot][0];
105 105
106 (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT", 106 (void) ngx_sprintf(p0, "%s, %02d %s %4d %02d:%02d:%02d GMT",
107 week[gmt.ngx_tm_wday], gmt.ngx_tm_mday, 107 week[gmt.ngx_tm_wday], gmt.ngx_tm_mday,
108 months[gmt.ngx_tm_mon - 1], gmt.ngx_tm_year, 108 months[gmt.ngx_tm_mon - 1], gmt.ngx_tm_year,
109 gmt.ngx_tm_hour, gmt.ngx_tm_min, gmt.ngx_tm_sec); 109 gmt.ngx_tm_hour, gmt.ngx_tm_min, gmt.ngx_tm_sec);
124 tp->gmtoff = ngx_timezone(tm.ngx_tm_isdst); 124 tp->gmtoff = ngx_timezone(tm.ngx_tm_isdst);
125 125
126 #endif 126 #endif
127 127
128 128
129 p1 = cached_err_log_time[slot]; 129 p1 = &cached_err_log_time[slot][0];
130 130
131 (void) ngx_sprintf(p1, "%4d/%02d/%02d %02d:%02d:%02d", 131 (void) ngx_sprintf(p1, "%4d/%02d/%02d %02d:%02d:%02d",
132 tm.ngx_tm_year, tm.ngx_tm_mon, 132 tm.ngx_tm_year, tm.ngx_tm_mon,
133 tm.ngx_tm_mday, tm.ngx_tm_hour, 133 tm.ngx_tm_mday, tm.ngx_tm_hour,
134 tm.ngx_tm_min, tm.ngx_tm_sec); 134 tm.ngx_tm_min, tm.ngx_tm_sec);
135 135
136 136
137 p2 = cached_http_log_time[slot]; 137 p2 = &cached_http_log_time[slot][0];
138 138
139 (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d", 139 (void) ngx_sprintf(p2, "%02d/%s/%d:%02d:%02d:%02d %c%02d%02d",
140 tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1], 140 tm.ngx_tm_mday, months[tm.ngx_tm_mon - 1],
141 tm.ngx_tm_year, tm.ngx_tm_hour, 141 tm.ngx_tm_year, tm.ngx_tm_hour,
142 tm.ngx_tm_min, tm.ngx_tm_sec, 142 tm.ngx_tm_min, tm.ngx_tm_sec,