check status of ftruncate() in ave/* fixes
This commit is contained in:
@ -504,7 +504,8 @@ void FixAveCorrelateLong::end_of_step()
|
||||
fflush(fp);
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -535,7 +535,8 @@ void FixAveCorrelate::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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -851,7 +851,8 @@ void FixAveHisto::end_of_step()
|
||||
fflush(fp);
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -493,7 +493,8 @@ void FixAveHistoWeight::end_of_step()
|
||||
fflush(fp);
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -698,7 +698,8 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user