* Crash recovery for com_pipeFile (Lakitu7)

This commit is contained in:
Tim Angus 2011-03-30 21:58:31 +00:00
parent 16b99e354b
commit 52ead6fa36
2 changed files with 10 additions and 3 deletions

View file

@ -943,6 +943,8 @@ fileHandle_t FS_FCreateOpenPipeFile( const char *filename ) {
}
else
{
Com_Printf( S_COLOR_YELLOW "WARNING: Could not create new com_pipefile at %s. "
"com_pipefile will not be used.\n", ospath );
f = 0;
}

View file

@ -255,8 +255,13 @@ Sys_Mkfifo
FILE *Sys_Mkfifo( const char *ospath )
{
FILE *fifo;
int result;
int fn;
int result;
int fn;
struct stat buf;
// if file already exists AND is a pipefile, remove it
if( !stat( ospath, &buf ) && S_ISFIFO( buf.st_mode ) )
FS_Remove( ospath );
result = mkfifo( ospath, 0600 );
if( result != 0 )