summaryrefslogtreecommitdiff
path: root/sysutils/tload/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/tload/patches/patch-aa')
-rw-r--r--sysutils/tload/patches/patch-aa46
1 files changed, 43 insertions, 3 deletions
diff --git a/sysutils/tload/patches/patch-aa b/sysutils/tload/patches/patch-aa
index 306cfa18ca9..499fe834053 100644
--- a/sysutils/tload/patches/patch-aa
+++ b/sysutils/tload/patches/patch-aa
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.1.1.1 1999/12/24 00:44:38 hubertf Exp $
+$NetBSD: patch-aa,v 1.2 2001/05/22 02:59:25 hubertf Exp $
---- tload.c.orig Fri Dec 24 00:45:47 1999
-+++ tload.c Fri Dec 24 00:52:03 1999
+--- tload.c.orig Tue Sep 2 18:02:19 1997
++++ tload.c
@@ -34,6 +34,25 @@
extern int optind;
extern char *optarg;
@@ -28,3 +28,43 @@ $NetBSD: patch-aa,v 1.1.1.1 1999/12/24 00:44:38 hubertf Exp $
void alrm(int n)
{
signal(SIGALRM, alrm);
+@@ -74,6 +93,11 @@
+ double av[3];
+ static double max_scale, scale_fact;
+ char *scale_arg = NULL;
++ static char hostname[256];
++ static char date[256];
++ time_t datet;
++ static char headl[256], headr[256];
++ int lenl, lenr;
+
+ while ((opt = getopt(argc, argv, "s:d:V")) != -1)
+ switch (opt) {
+@@ -94,6 +118,11 @@
+
+ setsize(0);
+
++ if (gethostname(hostname, sizeof(hostname)) < 0) {
++ perror(argv[optind]);
++ exit(1);
++ }
++
+ if (scale_arg)
+ max_scale = atof(scale_arg);
+ else
+@@ -144,8 +173,13 @@
+ for(row = nrows-2; row >= 0; --row)
+ *(screen + row * ncols + col) = ' ';
+ }
+- i = sprintf(screen, " %.2f, %.2f, %.2f",
+- av[0], av[1], av[2]);
++ datet = time(NULL);
++ strftime(date, sizeof(date), "%c", localtime(&datet));
++ lenr = sprintf(headr, "%s %s", hostname, date);
++ lenl = sprintf(headl, " %.2f, %.2f, %.2f",
++ av[0], av[1], av[2]);
++ i = sprintf(screen, "%s %*.s %s", headl,
++ ncols - lenl - lenr - 2, "", headr);
+ if (i>0)
+ screen[i] = ' ';
+