Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 112543
Collapse All | Expand All

(-)vsftpd-2.0.1/sysutil.c.use_localtime (-2 / +6 lines)
Lines 2372-2378 Link Here
2372
}
2372
}
2373
2373
2374
const char*
2374
const char*
2375
vsf_sysutil_get_current_date(void)
2375
vsf_sysutil_get_current_date(int use_localtime)
2376
{
2376
{
2377
  static char datebuf[64];
2377
  static char datebuf[64];
2378
  time_t curr_time;
2378
  time_t curr_time;
Lines 2380-2386 Link Here
2380
  int i = 0;
2380
  int i = 0;
2381
  vsf_sysutil_update_cached_time();
2381
  vsf_sysutil_update_cached_time();
2382
  curr_time = vsf_sysutil_get_cached_time_sec();
2382
  curr_time = vsf_sysutil_get_cached_time_sec();
2383
  p_tm = localtime(&curr_time);
2383
  if (!use_localtime) {  
2384
    p_tm = gmtime(&curr_time);
2385
  } else {
2386
    p_tm = localtime(&curr_time);
2387
  }
2384
  if (strftime(datebuf, sizeof(datebuf), "%a %b!%d %H:%M:%S %Y", p_tm) == 0)
2388
  if (strftime(datebuf, sizeof(datebuf), "%a %b!%d %H:%M:%S %Y", p_tm) == 0)
2385
  {
2389
  {
2386
    die("strftime");
2390
    die("strftime");
(-)vsftpd-2.0.1/logging.c.use_localtime (-2 / +2 lines)
Lines 171-177 Link Here
171
  long delta_sec;
171
  long delta_sec;
172
  enum EVSFLogEntryType what = (enum EVSFLogEntryType) p_sess->log_type;
172
  enum EVSFLogEntryType what = (enum EVSFLogEntryType) p_sess->log_type;
173
  /* Date - vsf_sysutil_get_current_date updates cached time */
173
  /* Date - vsf_sysutil_get_current_date updates cached time */
174
  str_alloc_text(p_str, vsf_sysutil_get_current_date());
174
  str_alloc_text(p_str, vsf_sysutil_get_current_date(tunable_use_localtime));
175
  str_append_char(p_str, ' ');
175
  str_append_char(p_str, ' ');
176
  /* Transfer time (in seconds) */
176
  /* Transfer time (in seconds) */
177
  delta_sec = vsf_sysutil_get_cached_time_sec() - p_sess->log_start_sec;
177
  delta_sec = vsf_sysutil_get_cached_time_sec() - p_sess->log_start_sec;
Lines 241-247 Link Here
241
                             const struct mystr* p_log_str)
241
                             const struct mystr* p_log_str)
242
{
242
{
243
  /* Date - vsf_sysutil_get_current_date updates cached time */
243
  /* Date - vsf_sysutil_get_current_date updates cached time */
244
  str_alloc_text(p_str, vsf_sysutil_get_current_date());
244
  str_alloc_text(p_str, vsf_sysutil_get_current_date(tunable_use_localtime));
245
  /* Pid */
245
  /* Pid */
246
  str_append_text(p_str, " [pid ");
246
  str_append_text(p_str, " [pid ");
247
  str_append_ulong(p_str, vsf_sysutil_getpid());
247
  str_append_ulong(p_str, vsf_sysutil_getpid());
(-)vsftpd-2.0.1/sysutil.h.use_localtime (-1 / +1 lines)
Lines 288-294 Link Here
288
void vsf_sysutil_set_umask(unsigned int umask);
288
void vsf_sysutil_set_umask(unsigned int umask);
289
void vsf_sysutil_make_session_leader(void);
289
void vsf_sysutil_make_session_leader(void);
290
void vsf_sysutil_tzset(void);
290
void vsf_sysutil_tzset(void);
291
const char* vsf_sysutil_get_current_date(void);
291
const char* vsf_sysutil_get_current_date(int use_localtime);
292
void vsf_sysutil_qsort(void* p_base, unsigned int num_elem,
292
void vsf_sysutil_qsort(void* p_base, unsigned int num_elem,
293
                       unsigned int elem_size,
293
                       unsigned int elem_size,
294
                       int (*p_compar)(const void *, const void *));
294
                       int (*p_compar)(const void *, const void *));

Return to bug 112543