* misc.c (GC_init): If "GC_LOG_FILE" environment variable is unset and
GC_LOG_TO_FILE_ALWAYS macro defined then open "gc.log" file for GC
logging (only Unix and Cygwin).
# if defined(UNIX_LIKE) || defined(CYGWIN32)
{
char * file_name = GETENV("GC_LOG_FILE");
- if (0 != file_name) {
+# ifdef GC_LOG_TO_FILE_ALWAYS
+ if (NULL == file_name)
+ file_name = "gc.log";
+# else
+ if (0 != file_name)
+# endif
+ {
int log_d = open(file_name, O_CREAT|O_WRONLY|O_APPEND, 0666);
if (log_d < 0) {
GC_err_printf("Failed to open %s as log file\n", file_name);