aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-17 18:54:05 -0700
committerChris Robinson <[email protected]>2011-06-17 18:54:05 -0700
commit157e1394d6d3d32630d287a9725396ec4dff24bb (patch)
treea6d61f716a70b199cc38bce460a54959c9139dbf
parentedf78b077efa5a8d3f11ea2059095f33e9f971a8 (diff)
Open the log file with config initialization
-rw-r--r--Alc/ALc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index d12e4733..09afd296 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -465,15 +465,7 @@ static void alc_init(void)
{
const char *str;
- str = getenv("ALSOFT_LOGFILE");
- if(str && str[0])
- {
- LogFile = fopen(str, "wat");
- if(!LogFile)
- fprintf(stderr, "AL lib: Failed to open log file '%s'\n", str);
- }
- if(!LogFile)
- LogFile = stderr;
+ LogFile = stderr;
str = getenv("__ALSOFT_HALF_ANGLE_CONES");
if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
@@ -519,6 +511,14 @@ static void alc_initconfig(void)
int i;
const char *devs, *str;
+ str = getenv("ALSOFT_LOGFILE");
+ if(str && str[0])
+ {
+ FILE *logfile = fopen(str, "wat");
+ if(logfile) LogFile = logfile;
+ else AL_PRINT("Failed to open log file '%s'\n", str);
+ }
+
ReadALConfig();
InitHrtf();