Changeset 52761cc
- Timestamp:
- Oct 23, 2009, 10:50:42 PM (15 years ago)
- 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)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rbdbec0a r52761cc 1228 1228 FILE *file; 1229 1229 time_t now; 1230 char buff1[LINE], buff2[LINE];1231 1230 va_list ap; 1232 1231 va_start(ap, fmt); 1233 1232 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)); 1246 1244 vfprintf(file, fmt, ap); 1247 fprintf(file, "\n");1245 putc('\n', file); 1248 1246 fclose(file); 1249 1247 -
global.c
r4f2166b r52761cc 527 527 } 528 528 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 538 529 const char *owl_global_get_hostname(const owl_global *g) { 539 530 if (g->thishost) return(g->thishost);
Note: See TracChangeset
for help on using the changeset viewer.