Changeset 6646fdb for functions.c


Ignore:
Timestamp:
Sep 7, 2011, 10:06:08 AM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
732d5c0, bcb84df
Parents:
3b17b57
git-author:
David Benjamin <davidben@mit.edu> (08/01/11 02:03:32)
git-committer:
David Benjamin <davidben@mit.edu> (09/07/11 10:06:08)
Message:
Restore correct semantics of message 'time' attribute

This rewrites part of 4ebbfbc5360fa004637dd101f5a0c833cdccd60a. We can't
replace every instance of ctime with a user-formatted time, as the time
attribute is not user-formatted. It is (unfortunately) the API for perl
to override the timestamp and owl_perlconfig_hashref2message expects a
particular format for strptime. We should not then flip the values
around once they reach C. (Especially not a locale-dependent one.)

Rename *_to_timestr functions to owl_util_format_* so it is clear the
function should only be used for user-formatted times.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r3b17b57 r6646fdb  
    12231223  now = time(NULL);
    12241224
    1225   tmpbuff = owl_util_time_to_timestr(localtime(&now));
     1225  tmpbuff = owl_util_format_time(localtime(&now));
    12261226  fprintf(file, "[%d -  %s - %lds]: ",
    12271227          (int) getpid(), tmpbuff, now - owl_global_get_starttime(&g));
     
    13731373  owl_fmtext fm, attrfm;
    13741374  const owl_view *v;
     1375  char *time;
    13751376#ifdef HAVE_LIBZEPHYR
    13761377  const ZNotice_t *n;
     
    14031404  }
    14041405
    1405   owl_fmtext_appendf_normal(&fm, "  Time      : %s\n", owl_message_get_timestr(m));
     1406  time = owl_message_format_time(m);
     1407  owl_fmtext_appendf_normal(&fm, "  Time      : %s\n", time);
     1408  g_free(time);
    14061409
    14071410  if (!owl_message_is_type_admin(m)) {
     
    17761779  owl_fmtext_append_normal(&fm, "\n");
    17771780
    1778   tmpbuff = owl_util_time_to_timestr(localtime(&start));
     1781  tmpbuff = owl_util_format_time(localtime(&start));
    17791782  owl_fmtext_appendf_normal(&fm, "  Startup Time: %s\n", tmpbuff);
    17801783  g_free(tmpbuff);
     
    30723075      idle=owl_buddy_get_idle_time(b);
    30733076      if (idle!=0) {
    3074         timestr=owl_util_minutes_to_timestr(idle);
     3077        timestr=owl_util_format_minutes(idle);
    30753078      } else {
    30763079        timestr=g_strdup("");
     
    34013404
    34023405  now = time(NULL);
    3403   date = owl_util_time_to_timestr(localtime(&now));
     3406  date = owl_util_format_time(localtime(&now));
    34043407
    34053408  buff = g_strdup_printf("%s %s", date, string);
Note: See TracChangeset for help on using the changeset viewer.