Skip to content

Commit

Permalink
Revert "debuglog: Don't use nested functions"
Browse files Browse the repository at this point in the history
This reverts commit 435dea9.
  • Loading branch information
krumberg committed Apr 8, 2012
1 parent 18627dd commit 347003c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/libs/debuglog/debuglog.c
Expand Up @@ -20,18 +20,16 @@
#include <stdio.h>
#include <stdlib.h>

static FILE* file = NULL;

static void closefile() {
fclose(file);
}

void debuglog(const char* line, ...)
{
static FILE* file = NULL;

if (file == NULL) {
file = fopen("debug.txt", "wt");

void closefile() {
fclose(file);
}
atexit(closefile);
}

Expand Down

0 comments on commit 347003c

Please sign in to comment.