diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index 6bd9854..930955e 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -513,6 +513,7 @@ void Sys_ErrorDialog( const char *error ) const char *homepath = Cvar_VariableString( "fs_homepath" ); const char *gamedir = Cvar_VariableString( "fs_game" ); const char *fileName = "crashlog.txt"; + char *dirpath = FS_BuildOSPath( homepath, gamedir, "" ); char *ospath = FS_BuildOSPath( homepath, gamedir, fileName ); Sys_Print( va( "%s\n", error ) ); @@ -522,9 +523,9 @@ void Sys_ErrorDialog( const char *error ) #endif // Make sure the write path for the crashlog exists... - if(!Sys_Mkdir(ospath)) + if(FS_CreatePath(dirpath)) { - Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", ospath); + Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", dirpath); return; } @@ -534,14 +535,14 @@ void Sys_ErrorDialog( const char *error ) f = open( ospath, O_CREAT | O_TRUNC | O_WRONLY, 0640 ); if( f == -1 ) { - Com_Printf( "ERROR: couldn't open %s\n", fileName ); + Com_Printf( "ERROR: couldn't open %s\n", ospath ); return; } // We're crashing, so we don't care much if write() or close() fails. while( ( size = CON_LogRead( buffer, sizeof( buffer ) ) ) > 0 ) { if( write( f, buffer, size ) != size ) { - Com_Printf( "ERROR: couldn't fully write to %s\n", fileName ); + Com_Printf( "ERROR: couldn't fully write to %s\n", ospath ); break; } }