/*
***************************************************************************
- * Read next sample statistics. If it's a special record (RESTART or COMMENT)
- * then display it if requested. Also fill timestamps structures.
+ * Read next sample statistics. If it's a special record (R_RESTART or
+ * R_COMMENT) then display it if requested. Also fill timestamps structures.
*
* IN:
* @ifd File descriptor
- * @action Flags indicating if special records should be displayed or not.
+ * @action Flags indicating if special records should be displayed or
+ * not.
*
* @curr Index in array for current sample statistics.
* @file System activity data file name (name of file being read).
- * @rtype Record type (RESTART, COMMENT, etc.)
* @tab Number of tabulations to print.
* @file_actlst List of (known or unknown) activities in file.
* @file_magic System activity file magic header.
* saved for current record.
*
* OUT:
- * @rectime Structure where timestamp (expressed in local time or in UTC
- * depending on whether options -T/-t have been used or not) has
- * been saved for current record.
- * @loctime Structure where timestamp (expressed in local time) has been
- * saved for current record.
+ * @rtype Type of record read (R_RESTART, R_COMMENT, etc.)
+ * @rectime Structure where timestamp (expressed in local time or in UTC
+ * depending on options used) has been saved for current record.
+ * If current record was a special one (RESTART or COMMENT) and
+ * noted to be ignored, then the timestamp is saved only if
+ * explicitly told to do so with the SET_TIMESTAMPS action flag.
+ * @loctime Structure where timestamp (expressed in local time) has been
+ * saved for current record.
+ * If current record was a special one (RESTART or COMMENT) and
+ * noted to be ignored, then the timestamp is saved only if
+ * explicitly told to do so with the SET_TIMESTAMPS action flag.
*
* RETURNS:
* TRUE if end of file has been reached.
if (lseek(ifd, MAX_COMMENT_LEN, SEEK_CUR) < MAX_COMMENT_LEN) {
perror("lseek");
}
+ if (action & SET_TIMESTAMPS) {
+ sa_get_record_timestamp_struct(flags, &record_hdr[curr],
+ rectime, loctime);
+ }
}
else {
/* Display COMMENT record */
read_vol_act_structures(ifd, act, file, file_magic,
file_hdr.sa_vol_act_nr);
}
+ if (action & SET_TIMESTAMPS) {
+ sa_get_record_timestamp_struct(flags, &record_hdr[curr],
+ rectime, loctime);
+ }
}
else {
/* Display RESTART record */