Changeset 131 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Oct 22, 2007, 11:19:15 PM (17 years ago)
Author:
rainer
Message:

Use thread-safe libc functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r115 r131  
    36653665  time_t then = (time_t) p->theFile.mtime;
    36663666
     3667#if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R)
     3668  struct tm   * time_ptr;
     3669  struct tm     time_tm;
     3670
     3671  time_ptr = gmtime_r(&then, &time_tm);
     3672  strftime(thetime, 127, _("%b %d  %Y"), time_ptr);
     3673  time_ptr = gmtime_r(&now,  &time_tm);
     3674  strftime(nowtime, 127, _("%b %d  %Y"), time_ptr);
     3675  if (0 == strncmp(&nowtime[7], &thetime[7], 4))
     3676    {
     3677      time_ptr = gmtime_r(&then, &time_tm);
     3678      strftime(thetime, 127, _("%b %d %H:%M"), time_ptr);
     3679    }
     3680#else
    36673681  strftime(thetime, 127, _("%b %d  %Y"), gmtime(&then));
    36683682  strftime(nowtime, 127, _("%b %d  %Y"), gmtime(&now));
    36693683  if (0 == strncmp(&nowtime[7], &thetime[7], 4))
    36703684    strftime(thetime, 127, _("%b %d %H:%M"), gmtime(&then));
     3685#endif
    36713686
    36723687  tmp = sh_util_safe_name(p->fullpath);
Note: See TracChangeset for help on using the changeset viewer.