diff options
author | hubertf <hubertf> | 2001-05-22 02:59:25 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2001-05-22 02:59:25 +0000 |
commit | 45119fa5bc9791a347cd0103ff7ab1c854fa1493 (patch) | |
tree | 197411a8fcc5b39f3df02c9b36f95061385b6135 /sysutils | |
parent | ad1aa73460c4225e5477db22668eb1a398562681 (diff) | |
download | pkgsrc-45119fa5bc9791a347cd0103ff7ab1c854fa1493.tar.gz |
Update to 2.0.6nb1:
Add hostname, time and date to the top line
Patch send back to the maintainers @redhat.com
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/tload/Makefile | 4 | ||||
-rw-r--r-- | sysutils/tload/distinfo | 4 | ||||
-rw-r--r-- | sysutils/tload/patches/patch-aa | 46 |
3 files changed, 47 insertions, 7 deletions
diff --git a/sysutils/tload/Makefile b/sysutils/tload/Makefile index e1b61b31163..ad2f7811d76 100644 --- a/sysutils/tload/Makefile +++ b/sysutils/tload/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.3 2001/03/31 11:14:31 zuntum Exp $ +# $NetBSD: Makefile,v 1.4 2001/05/22 02:59:25 hubertf Exp $ # DISTNAME= procps-2.0.6 -PKGNAME= tload-2.0.6 +PKGNAME= tload-2.0.6nb1 CATEGORIES= sysutils MASTER_SITES= ftp://people.redhat.com/johnsonm/procps/ diff --git a/sysutils/tload/distinfo b/sysutils/tload/distinfo index e0acd5a6945..39ee26d8a46 100644 --- a/sysutils/tload/distinfo +++ b/sysutils/tload/distinfo @@ -1,5 +1,5 @@ -$NetBSD: distinfo,v 1.2 2001/04/19 11:29:09 agc Exp $ +$NetBSD: distinfo,v 1.3 2001/05/22 02:59:25 hubertf Exp $ SHA1 (procps-2.0.6.tar.gz) = 8006cbc096922c53d340cdfe1e8dd9504cd2e203 Size (procps-2.0.6.tar.gz) = 188674 bytes -SHA1 (patch-aa) = 4d4c87c08fbedf0fcaafa25b69aea7a757891f24 +SHA1 (patch-aa) = 955d3d9d425a7264cb1a5aea450694a3634a136c 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] = ' '; + |