Changeset 131 for trunk/src/sh_html.c
- Timestamp:
- Oct 22, 2007, 11:19:15 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_html.c
r34 r131 34 34 #endif 35 35 #endif 36 #include <unistd.h> 36 37 37 38 … … 90 91 time_t now; 91 92 struct tm * time_ptr; 93 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 94 struct tm time_tm; 95 #endif 92 96 93 97 char * formatted; … … 148 152 if (!SL_ISERROR(status)) 149 153 { 154 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 155 time_ptr = localtime_r (&(server_status.start), &time_tm); 156 #else 150 157 time_ptr = localtime (&(server_status.start)); 158 #endif 151 159 if (time_ptr != NULL) 152 160 status = strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr); 153 161 now = time(NULL); 162 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 163 time_ptr = localtime_r (&now, &time_tm); 164 #else 154 165 time_ptr = localtime (&now); 166 #endif 155 167 if (time_ptr != NULL) 156 168 status = strftime (ts2, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr); … … 174 186 if (server_status.last > (time_t) 0) 175 187 { 188 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 189 time_ptr = localtime_r (&(server_status.last), &time_tm); 190 #else 176 191 time_ptr = localtime (&(server_status.last)); 192 #endif 177 193 if (time_ptr != NULL) 178 194 status = strftime (ts1, 80, _("%d-%m-%Y %H:%M:%S"), time_ptr);
Note:
See TracChangeset
for help on using the changeset viewer.