View | Details | Raw Unified | Return to bug 267710 | Differences between
and this patch

Collapse All | Expand All

(-)b/net/pload/Makefile (-1 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	pload
1
PORTNAME=	pload
2
PORTVERSION=	0.9.5
2
PORTVERSION=	0.9.5
3
PORTREVISION=	4
3
PORTREVISION=	5
4
CATEGORIES=	net sysutils
4
CATEGORIES=	net sysutils
5
MASTER_SITES=	http://opal.com/src/pload/ LOCAL/pav
5
MASTER_SITES=	http://opal.com/src/pload/ LOCAL/pav
6
6
(-)b/net/pload/files/patch-Imakefile (-20 / +11 lines)
Lines 1-20 Link Here
1
diff -c Imakefile.orig Imakefile
1
--- Imakefile.orig	2000-02-01 07:11:24 UTC
2
*** Imakefile.orig	Tue Feb  1 02:11:24 2000
2
+++ Imakefile
3
--- Imakefile	Tue Aug  3 10:02:12 2004
3
@@ -15,7 +15,7 @@ DEFINES = -DVERSION="\"Pload version $(VER)\"" $(OSDEF
4
***************
4
 
5
*** 15,21 ****
5
 ComplexProgramTarget(pload)
6
  
6
 
7
  ComplexProgramTarget(pload)
7
-distclean: clean	
8
  
8
+distclean:: clean	
9
! distclean: clean	
9
 	$(RM) Makefile osdefs.mk core \
10
  	$(RM) Makefile osdefs.mk core \
10
 	pload-$(VER).tar.gz \
11
  	pload-$(VER).tar.gz \
11
 	pload-$(VER)-1.i386.rpm \
12
  	pload-$(VER)-1.i386.rpm \
13
--- 15,21 ----
14
  
15
  ComplexProgramTarget(pload)
16
  
17
! distclean:: clean	
18
  	$(RM) Makefile osdefs.mk core \
19
  	pload-$(VER).tar.gz \
20
  	pload-$(VER)-1.i386.rpm \
(-)b/net/pload/files/patch-ioctl__stat.c (-5 / +5 lines)
Lines 1-5 Link Here
1
--- ioctl_stat.c.orig	2000-02-01 02:11:24.000000000 -0500
1
--- ioctl_stat.c.orig	2000-02-01 07:11:24 UTC
2
+++ ioctl_stat.c	2009-06-15 15:30:03.000000000 -0400
2
+++ ioctl_stat.c
3
@@ -30,6 +30,12 @@
3
@@ -30,6 +30,12 @@
4
 #include <fcntl.h>		/* open */
4
 #include <fcntl.h>		/* open */
5
 #include <sys/ioctl.h>		/* ioctl */
5
 #include <sys/ioctl.h>		/* ioctl */
Lines 26-32 Link Here
26
 #	endif	/* linux && __GLIBC__ < 2 */
26
 #	endif	/* linux && __GLIBC__ < 2 */
27
 #else	/* STREAMS */			/* Solaris, SunOS, OSF/1, SVR4 */
27
 #else	/* STREAMS */			/* Solaris, SunOS, OSF/1, SVR4 */
28
 #	include <net/ppp_defs.h>
28
 #	include <net/ppp_defs.h>
29
@@ -61,8 +69,18 @@
29
@@ -61,8 +69,18 @@ void getsocket(if_data *ifd)
30
 void ioctl_stat(if_data *ifd)
30
 void ioctl_stat(if_data *ifd)
31
 {
31
 {
32
 	struct ifreq ifr;
32
 	struct ifreq ifr;
Lines 46-52 Link Here
46
 	if (!ifd->s) getsocket(ifd);
46
 	if (!ifd->s) getsocket(ifd);
47
 	
47
 	
48
 	memset(&ifr, 0, sizeof(ifr));
48
 	memset(&ifr, 0, sizeof(ifr));
49
@@ -76,7 +94,9 @@
49
@@ -76,7 +94,9 @@ void ioctl_stat(if_data *ifd)
50
 		return;
50
 		return;
51
 	}
51
 	}
52
 	
52
 	
Lines 56-62 Link Here
56
 
56
 
57
 #ifdef linux
57
 #ifdef linux
58
 	req.stats_ptr = (caddr_t) &req.stats;
58
 	req.stats_ptr = (caddr_t) &req.stats;
59
@@ -84,18 +104,36 @@
59
@@ -84,18 +104,36 @@ void ioctl_stat(if_data *ifd)
60
 #define ifr_name ifr__name
60
 #define ifr_name ifr__name
61
 #endif	
61
 #endif	
62
 
62
 
(-)b/net/pload/files/patch-pload.c (-73 / +74 lines)
Lines 1-73 Link Here
1
diff -c pload.c.orig pload.c
1
--- pload.c.orig	2000-02-01 07:11:24 UTC
2
*** pload.c.orig	Tue Feb  1 02:11:24 2000
2
+++ pload.c
3
--- pload.c	Wed Sep 22 13:13:46 2004
3
@@ -285,6 +285,13 @@ static XtResource pload_resources[] = {
4
***************
4
 /************* Main () ******************/
5
*** 596,608 ****
5
 int main (int argc, char *argv[])
6
  void do_total(char *b, double total)
6
 {
7
  {
7
+	char *orig_argv[64];
8
  	if (total < 1024.0)
8
+	int i;
9
! 		sprintf(b, "%s%0.0f b", b, total);
9
+
10
  	else if (total < (1024.0*1024.0))
10
+	/* save original argv pointers */
11
! 		sprintf(b, "%s%0.2f k", b, total/1024.0);
11
+	for(i = 0; argv[i]; i++)
12
  	else if (total < (1024.0*1024.0*1024.0))
12
+		orig_argv[i] = argv[i];
13
! 		sprintf(b, "%s%0.2f M", b, total/1024.0/1024.0);
13
+
14
  	else
14
 	Progname = argv[0];
15
! 		sprintf(b, "%s%0.2f G", b, total/1024.0/1024.0/1024.0);
15
 	
16
  	
16
 	toplevel = XtAppInitialize (
17
  	return;
17
@@ -301,6 +308,11 @@ int main (int argc, char *argv[])
18
  }
18
 	   and exit */	
19
--- 596,608 ----
19
 	if (argc != 1) Usage();
20
  void do_total(char *b, double total)
20
 	
21
  {
21
+	/* XtAppInitialize() eats the arguments, so restore original
22
  	if (total < 1024.0)
22
+	   argv so that ps(1) shows the command line */
23
! 		sprintf(b, "%s%0.0f B", b, total);
23
+	for(i = 0; orig_argv[i]; i++)
24
  	else if (total < (1024.0*1024.0))
24
+		argv[i] = orig_argv[i];
25
! 		sprintf(b, "%s%0.2f kB", b, total/1024.0);
25
+
26
  	else if (total < (1024.0*1024.0*1024.0))
26
 	XtGetApplicationResources(
27
! 		sprintf(b, "%s%0.2f MB", b, total/1024.0/1024.0);
27
 		toplevel,			/* widget */
28
  	else
28
 		(XtPointer) &resources, 	/* where to put */
29
! 		sprintf(b, "%s%0.2f GB", b, total/1024.0/1024.0/1024.0);
29
@@ -596,27 +608,26 @@ void CheckForWMExit(	Widget w, 
30
  	
30
 void do_total(char *b, double total)
31
  	return;
31
 {
32
  }
32
 	if (total < 1024.0)
33
***************
33
-		sprintf(b, "%s%0.0f b", b, total);
34
*** 610,622 ****
34
+		sprintf(b, "%s%0.0f B", b, total);
35
  void do_rate(char *b, double rate)
35
 	else if (total < (1024.0*1024.0))
36
  {
36
-		sprintf(b, "%s%0.2f k", b, total/1024.0);
37
  	if (rate < 1024.0)
37
+		sprintf(b, "%s%0.2f kiB", b, total/1024.0);
38
! 		sprintf(b, "%s%0.0f b/s",b, rate);
38
 	else if (total < (1024.0*1024.0*1024.0))
39
  	else if (rate < (1024.0*1024.0))
39
-		sprintf(b, "%s%0.2f M", b, total/1024.0/1024.0);
40
! 		sprintf(b, "%s%0.2f k/s",b, rate/1024.0);
40
+		sprintf(b, "%s%0.2f MiB", b, total/1024.0/1024.0);
41
  	else if (rate < (1024.0*1024.0*1024.0))
41
 	else
42
! 		sprintf(b, "%s%0.2f M/s",b, rate/1024.0/1024.0);
42
-		sprintf(b, "%s%0.2f G", b, total/1024.0/1024.0/1024.0);
43
  	else
43
-	
44
! 		sprintf(b, "%s%0.2f G/s", b, rate/1024.0/1024.0/1024.0);
44
+		sprintf(b, "%s%0.2f GiB", b, total/1024.0/1024.0/1024.0);
45
  	return;
45
 	return;
46
  }
46
 }
47
  
47
 
48
--- 610,622 ----
48
 void do_rate(char *b, double rate)
49
  void do_rate(char *b, double rate)
49
 {
50
  {
50
 	if (rate < 1024.0)
51
  	if (rate < 1024.0)
51
-		sprintf(b, "%s%0.0f b/s",b, rate);
52
! 		sprintf(b, "%s%0.0f B/s",b, rate);
52
+		sprintf(b, "%s%0.0f B/s",b, rate);
53
  	else if (rate < (1024.0*1024.0))
53
 	else if (rate < (1024.0*1024.0))
54
! 		sprintf(b, "%s%0.2f kB/s",b, rate/1024.0);
54
-		sprintf(b, "%s%0.2f k/s",b, rate/1024.0);
55
  	else if (rate < (1024.0*1024.0*1024.0))
55
+		sprintf(b, "%s%0.2f kiB/s",b, rate/1024.0);
56
! 		sprintf(b, "%s%0.2f MB/s",b, rate/1024.0/1024.0);
56
 	else if (rate < (1024.0*1024.0*1024.0))
57
  	else
57
-		sprintf(b, "%s%0.2f M/s",b, rate/1024.0/1024.0);
58
! 		sprintf(b, "%s%0.2f GB/s", b, rate/1024.0/1024.0/1024.0);
58
+		sprintf(b, "%s%0.2f MiB/s",b, rate/1024.0/1024.0);
59
  	return;
59
 	else
60
  }
60
-		sprintf(b, "%s%0.2f G/s", b, rate/1024.0/1024.0/1024.0);
61
  
61
+		sprintf(b, "%s%0.2f GiB/s", b, rate/1024.0/1024.0/1024.0);
62
***************
62
 	return;
63
*** 643,648 ****
63
 }
64
--- 643,651 ----
64
 
65
  					break;
65
@@ -643,6 +654,9 @@ void make_label(char *fmt, unsigned long total, double
66
  				case 'M':
66
 					break;
67
  					do_rate(buff, max);
67
 				case 'M':
68
+ 					break;
68
 					do_rate(buff, max);
69
+ 				case 'd':
69
+					break;
70
+ 					sprintf(buff, "%s", resources.device);
70
+				case 'd':
71
  					break;
71
+					strcat(buff, resources.device);
72
  				case '%':	/* literal % */
72
 					break;
73
  					i = strlen(buff);
73
 				case '%':	/* literal % */
74
 					i = strlen(buff);
(-)b/net/pload/files/patch-pload.man (-4 / +4 lines)
Lines 1-5 Link Here
1
--- pload.man.orig	Tue Feb  1 02:11:24 2000
1
--- pload.man.orig	2000-02-01 07:11:24 UTC
2
+++ pload.man	Wed Sep 22 16:44:12 2004
2
+++ pload.man
3
@@ -18,7 +18,7 @@
3
@@ -18,7 +18,7 @@
4
 .TH PLOAD 1 "" "January 2000"
4
 .TH PLOAD 1 "" "January 2000"
5
 
5
 
Lines 9-15 Link Here
9
 
9
 
10
 .SH SYNOPSIS
10
 .SH SYNOPSIS
11
 .ta 6n
11
 .ta 6n
12
@@ -30,9 +30,9 @@
12
@@ -30,9 +30,9 @@ pload \- display ppp throughput statistics in an X win
13
 [-iformat \fIfmt\fP] [-oformat \fIfmt\fP] 
13
 [-iformat \fIfmt\fP] [-oformat \fIfmt\fP] 
14
 
14
 
15
 .SH DESCRIPTION
15
 .SH DESCRIPTION
Lines 22-28 Link Here
22
 
22
 
23
 .SH OPTIONS
23
 .SH OPTIONS
24
 .PP
24
 .PP
25
@@ -144,7 +144,7 @@
25
@@ -144,7 +144,7 @@ Display \fImessage\fP in the labels when offline. The 
26
 .TP 8
26
 .TP 8
27
 .B \-iformat \fIfmt\fP
27
 .B \-iformat \fIfmt\fP
28
 Use string \fIfmt\fP for the inbound label. The \fIfmt\fP string will be displayed
28
 Use string \fIfmt\fP for the inbound label. The \fIfmt\fP string will be displayed

Return to bug 267710