Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
#define DEF_TMEND "18:00:00"
#define UTSNAME_LEN 65
+#define TZNAME_LEN 8
#define HEADER_LINE_LEN 512
/*
* Machine architecture.
*/
char sa_machine[UTSNAME_LEN];
+ /*
+ * Timezone value.
+ */
+ char sa_tzname[TZNAME_LEN];
};
#define FILE_HEADER_SIZE (sizeof(struct file_header))
extern time_t __unix_time;
#endif
+extern char *tzname[2];
+
long interval = 0;
uint64_t flags = 0;
strncpy(file_hdr.sa_machine, header.machine, UTSNAME_LEN);
file_hdr.sa_machine[UTSNAME_LEN - 1] = '\0';
+ /* Get timezone value and save it */
+ tzset();
+ strncpy(file_hdr.sa_tzname, tzname[0], TZNAME_LEN);
+ file_hdr.sa_tzname[TZNAME_LEN - 1] = '\0';
+
/* Write file header */
if (write_all(fd, &file_hdr, FILE_HEADER_SIZE) != FILE_HEADER_SIZE) {
p_write_error();