summaryrefslogtreecommitdiffstats
path: root/net/pload/files/patch-pload.c
blob: 0fb88df906b196d1c5099e36359f11f7c646577d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff -c pload.c.orig pload.c
*** pload.c.orig	Tue Feb  1 02:11:24 2000
--- pload.c	Wed Sep 22 13:13:46 2004
***************
*** 596,608 ****
  void do_total(char *b, double total)
  {
  	if (total < 1024.0)
! 		sprintf(b, "%s%0.0f b", b, total);
  	else if (total < (1024.0*1024.0))
! 		sprintf(b, "%s%0.2f k", b, total/1024.0);
  	else if (total < (1024.0*1024.0*1024.0))
! 		sprintf(b, "%s%0.2f M", b, total/1024.0/1024.0);
  	else
! 		sprintf(b, "%s%0.2f G", b, total/1024.0/1024.0/1024.0);
  	
  	return;
  }
--- 596,608 ----
  void do_total(char *b, double total)
  {
  	if (total < 1024.0)
! 		sprintf(b, "%s%0.0f B", b, total);
  	else if (total < (1024.0*1024.0))
! 		sprintf(b, "%s%0.2f kB", b, total/1024.0);
  	else if (total < (1024.0*1024.0*1024.0))
! 		sprintf(b, "%s%0.2f MB", b, total/1024.0/1024.0);
  	else
! 		sprintf(b, "%s%0.2f GB", b, total/1024.0/1024.0/1024.0);
  	
  	return;
  }
***************
*** 610,622 ****
  void do_rate(char *b, double rate)
  {
  	if (rate < 1024.0)
! 		sprintf(b, "%s%0.0f b/s",b, rate);
  	else if (rate < (1024.0*1024.0))
! 		sprintf(b, "%s%0.2f k/s",b, rate/1024.0);
  	else if (rate < (1024.0*1024.0*1024.0))
! 		sprintf(b, "%s%0.2f M/s",b, rate/1024.0/1024.0);
  	else
! 		sprintf(b, "%s%0.2f G/s", b, rate/1024.0/1024.0/1024.0);
  	return;
  }
  
--- 610,622 ----
  void do_rate(char *b, double rate)
  {
  	if (rate < 1024.0)
! 		sprintf(b, "%s%0.0f B/s",b, rate);
  	else if (rate < (1024.0*1024.0))
! 		sprintf(b, "%s%0.2f kB/s",b, rate/1024.0);
  	else if (rate < (1024.0*1024.0*1024.0))
! 		sprintf(b, "%s%0.2f MB/s",b, rate/1024.0/1024.0);
  	else
! 		sprintf(b, "%s%0.2f GB/s", b, rate/1024.0/1024.0/1024.0);
  	return;
  }
  
***************
*** 643,648 ****
--- 643,651 ----
  					break;
  				case 'M':
  					do_rate(buff, max);
+ 					break;
+ 				case 'd':
+ 					sprintf(buff, "%s", resources.device);
  					break;
  				case '%':	/* literal % */
  					i = strlen(buff);
OpenPOWER on IntegriCloud