Changeset 52761cc


Ignore:
Timestamp:
Oct 23, 2009, 10:50:42 PM (14 years ago)
Author:
Karl Ramm <kcr@1ts.org>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
23fddad
Parents:
84ea53c
git-author:
Karl Ramm <kcr@1ts.org> (09/21/09 15:48:11)
git-committer:
Karl Ramm <kcr@1ts.org> (10/23/09 22:50:42)
Message:
Cleanup owl_function_debugmsg.

Nuke two buff[LINE]s in owl_function_debugmsg.
Remove now-unused owl_global_get_runtime_string.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rbdbec0a r52761cc  
    12281228  FILE *file;
    12291229  time_t now;
    1230   char buff1[LINE], buff2[LINE];
    12311230  va_list ap;
    12321231  va_start(ap, fmt);
    12331232
    1234   if (!owl_global_is_debug_fast(&g)) return;
    1235 
    1236   file=fopen(owl_global_get_debug_file(&g), "a");
    1237   if (!file) return;
    1238 
    1239   now=time(NULL);
    1240   strcpy(buff1, ctime(&now));
    1241   buff1[strlen(buff1)-1]='\0';
    1242 
    1243   owl_global_get_runtime_string(&g, buff2);
    1244  
    1245   fprintf(file, "[%i -  %s - %s]: ", (int) getpid(), buff1, buff2);
     1233  if (!owl_global_is_debug_fast(&g))
     1234    return;
     1235
     1236  file = fopen(owl_global_get_debug_file(&g), "a");
     1237  if (!file) /* XXX should report this */
     1238    return;
     1239
     1240  now = time(NULL);
     1241
     1242  fprintf(file, "[%d -  %.24s - %lds]: ",
     1243          (int) getpid(), ctime(&now), now - owl_global_get_starttime(&g));
    12461244  vfprintf(file, fmt, ap);
    1247   fprintf(file, "\n");
     1245  putc('\n', file);
    12481246  fclose(file);
    12491247
  • global.c

    r4f2166b r52761cc  
    527527}
    528528
    529 void owl_global_get_runtime_string(const owl_global *g, char *buff) {
    530   time_t diff;
    531 
    532   diff=time(NULL)-owl_global_get_starttime(g);
    533 
    534   /* print something nicer later */   
    535   sprintf(buff, "%i seconds", (int) diff);
    536 }
    537 
    538529const char *owl_global_get_hostname(const owl_global *g) {
    539530  if (g->thishost) return(g->thishost);
Note: See TracChangeset for help on using the changeset viewer.