Unverified Commit bf537ded authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

check status of ftruncate() in ave/* fixes

parent f4fcd2a9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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");
    }
  }

+2 −1
Original line number Diff line number Diff line
@@ -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");
    }
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -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");
    }
  }

+2 −1
Original line number Diff line number Diff line
@@ -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");
    }
  }
}
+2 −1
Original line number Diff line number Diff line
@@ -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");
    }
  }
}
Loading