check status of ftruncate() in ave/* fixes

This commit is contained in:
Axel Kohlmeyer
2019-10-19 10:49:05 -04:00
parent f4fcd2a911
commit bf537dedf5
6 changed files with 12 additions and 6 deletions

View File

@ -1055,7 +1055,8 @@ void FixAveChunk::end_of_step()
if (overwrite) {
long fileend = ftell(fp);
if (fileend > 0) ftruncate(fileno(fp),fileend);
if ((fileend > 0) && (ftruncate(fileno(fp),fileend)))
perror("Error while tuncating output");
}
}
}