Changeset 26a1398 for global.c


Ignore:
Timestamp:
Jul 27, 2010, 9:10:44 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.6
Children:
6687135
Parents:
0f6ea94
git-author:
Nelson Elhage <nelhage@mit.edu> (07/15/10 23:35:12)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/27/10 21:10:44)
Message:
Keep the debug file open persistently.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r9e0bc3b r26a1398  
    10031003  g->interrupted = 0;
    10041004}
     1005
     1006FILE *owl_global_get_debug_file_handle(owl_global *g) {
     1007  static char *open_file = NULL;
     1008  const char *filename = owl_global_get_debug_file(g);
     1009  if (g->debug_file == NULL ||
     1010      (open_file && strcmp(filename, open_file) != 0)) {
     1011    if (g->debug_file)
     1012      fclose(g->debug_file);
     1013    g->debug_file = fopen(filename, "a");
     1014
     1015    owl_free(open_file);
     1016    open_file = owl_strdup(filename);
     1017  }
     1018  return g->debug_file;
     1019}
Note: See TracChangeset for help on using the changeset viewer.