activity.
* [Peter Schiffer]: sar: Use /sys/dev/block/major:minor links
to determine devices real name.
+ * Part of 'sadf -H' output was written to stderr instead of
+ stdout. This is now fixed.
* [Peter Schiffer]: Various cosmetic changes in manual pages
and usage messages displayed by sysstat commands.
* sar and iostat manual pages updated.
/*
* sar/sadc: Report system activity
- * (C) 1999-2011 by Sebastien Godard (sysstat <at> orange.fr)
+ * (C) 1999-2012 by Sebastien Godard (sysstat <at> orange.fr)
*/
#ifndef _SA_H
#define _SA_H
+#include <stdio.h>
+
#include "common.h"
#include "rd_stats.h"
#include "rd_sensors.h"
extern int
datecmp(struct tm *, struct tstamp *);
extern void
- display_sa_file_version(struct file_magic *);
+ display_sa_file_version(FILE *, struct file_magic *);
extern void
free_bitmaps(struct activity * []);
extern void
* Display sysstat version used to create system activity data file.
*
* IN:
- * @file_magic File magic header
+ * @st Output stream (stderr or stdout).
+ * @file_magic File magic header.
***************************************************************************
*/
-void display_sa_file_version(struct file_magic *file_magic)
+void display_sa_file_version(FILE *st, struct file_magic *file_magic)
{
- fprintf(stderr, _("File created using sar/sadc from sysstat version %d.%d.%d"),
+ fprintf(st, _("File created using sar/sadc from sysstat version %d.%d.%d"),
file_magic->sysstat_version,
file_magic->sysstat_patchlevel,
file_magic->sysstat_sublevel);
if (file_magic->sysstat_extraversion) {
- fprintf(stderr, ".%d", file_magic->sysstat_extraversion);
+ fprintf(st, ".%d", file_magic->sysstat_extraversion);
}
- fprintf(stderr, "\n");
+ fprintf(st, "\n");
}
/*
if ((n == FILE_MAGIC_SIZE) && (file_magic->sysstat_magic == SYSSTAT_MAGIC)) {
/* This is a sysstat file, but this file has an old format */
- display_sa_file_version(file_magic);
+ display_sa_file_version(stderr, file_magic);
fprintf(stderr,
_("Current sysstat version can no longer read the format of this file (%#x)\n"),
printf(_("System activity data file: %s (%#x)\n"),
dfile, file_magic->format_magic);
- display_sa_file_version(file_magic);
+ display_sa_file_version(stdout, file_magic);
if (file_magic->format_magic != FORMAT_MAGIC) {
return;