Changeset 52761cc7346cb35d2d70160f25573df691427ef2
- Timestamp:
- 10/23/09 22:50:42 (5 weeks ago)
- Author:
- Karl Ramm <kcr@1ts.org>
- git-author:
- Karl Ramm <kcr@1ts.org> / 2009-09-21T15:48:11Z-0400
- Parents:
- 84ea53cceca0c0915283fccbb9e6fece4cbcc25f
- Children:
- 23fddadbb7a375688e9be9627f1f5ca39aaa54d0
- git-committer:
- Karl Ramm <kcr@1ts.org> / 2009-10-23T22:50:42Z-0400
- Message:
-
Cleanup owl_function_debugmsg.
Nuke two buff[LINE]s in owl_function_debugmsg.
Remove now-unused owl_global_get_runtime_string.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
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 | |
-
|
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); |