don't remove() /dev/null (#316)

dev
Yann Collet 2016-09-07 07:00:08 +02:00
parent 0e07bf3f60
commit aad9fe5470
1 changed files with 4 additions and 1 deletions

View File

@ -732,7 +732,10 @@ static int FIO_decompressDstFile(dRess_t ress,
result = FIO_decompressSrcFile(ress, srcFileName);
if (fclose(ress.dstFile)) EXM_THROW(38, "Write error : cannot properly close %s", dstFileName);
if (result != 0) if (remove(dstFileName)) result=1; /* don't do anything if remove fails */
if ( (result != 0)
&& strcmp(dstFileName, nulmark) /* special case : don't remove() /dev/null (#316) */
&& remove(dstFileName) )
result=1; /* don't do anything special if remove fails */
return result;
}