/*
* sar: report system activity
- * (C) 1999-2020 by Sebastien GODARD (sysstat <at> orange.fr)
+ * (C) 1999-2021 by Sebastien GODARD (sysstat <at> orange.fr)
*
***************************************************************************
* This program is free software; you can redistribute it and/or modify it *
cross_day = TRUE;
}
- /* Get interval value in 1/100th of a second */
- get_itv_value(&record_hdr[curr], &record_hdr[!curr], &itv);
-
/* Check time (2) */
if (use_tm_end && (datecmp(&rectime, &tm_end, cross_day) > 0)) {
/* End time exceeded */
return 0;
}
+ /* Get interval value in 1/100th of a second */
+ get_itv_value(&record_hdr[curr], &record_hdr[!curr], &itv);
+
avg_count++;
/* Test stdout */
if (rtype != R_COMMENT) {
/* Read the extra fields since it's not a special record */
- read_file_stat_bunch(act, *curr, ifd, file_hdr.sa_act_nr, file_actlst,
- endian_mismatch, arch_64, file, file_magic, UEOF_STOP);
+ if (read_file_stat_bunch(act, *curr, ifd, file_hdr.sa_act_nr, file_actlst,
+ endian_mismatch, arch_64, file, file_magic, UEOF_STOP))
+ /* Error or unexpected EOF */
+ break;
}
else {
/* Display comment */
* OK: Previous record was not a special one.
* So read now the extra fields.
*/
- read_file_stat_bunch(act, 0, ifd, file_hdr.sa_act_nr,
- file_actlst, endian_mismatch, arch_64,
- from_file, &file_magic, UEOF_STOP);
+ if (read_file_stat_bunch(act, 0, ifd, file_hdr.sa_act_nr,
+ file_actlst, endian_mismatch, arch_64,
+ from_file, &file_magic, UEOF_STOP))
+ /* Possible unexpected EOF */
+ return;
+
if (sa_get_record_timestamp_struct(flags + S_F_LOCAL_TIME,
&record_hdr[0], &rectime))
/*
break;
if (rtype != R_COMMENT) {
- read_file_stat_bunch(act, curr, ifd, file_hdr.sa_act_nr,
- file_actlst, endian_mismatch, arch_64,
- from_file, &file_magic, UEOF_STOP);
+ if (read_file_stat_bunch(act, curr, ifd, file_hdr.sa_act_nr,
+ file_actlst, endian_mismatch, arch_64,
+ from_file, &file_magic, UEOF_STOP))
+ /* Possible unexpected EOF */
+ break;
}
else {
/* This was a COMMENT record: Print it */