Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong
GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/packages/extras-buildpkgs/htop/debian/patches/remove-fancy-flashing.patch
8661 views
1
diff --git a/BlockDevice_ioStatsMeter.c b/BlockDevice_ioStatsMeter.c
2
index 9dccbde..95532cd 100644
3
--- a/BlockDevice_ioStatsMeter.c
4
+++ b/BlockDevice_ioStatsMeter.c
5
@@ -26,7 +26,6 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in
6
char block_device[80];
7
static double old = 0.;
8
static double now = 0.;
9
- static int flash = 0;
10
static unsigned long sec_size = 0;
11
FILE *fp;
12
13
@@ -81,11 +80,7 @@ static void BlockDevice_sda_ioStatsMeter_setValues(Meter* this, char* buffer, in
14
Platform_BlockDevice_sda_stats.write_sectors_comp = Platform_BlockDevice_sda_stats.write_sectors;
15
16
} else {
17
- if (!(flash % 2))
18
- xSnprintf(buffer, len, "%s", "unavailable");
19
- else
20
- xSnprintf(buffer, len, "%s", "");
21
- flash++;
22
+ xSnprintf(buffer, len, "%s", "unavailable");
23
}
24
}
25
26
@@ -112,7 +107,6 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in
27
char block_device[80];
28
static double old = 0.;
29
static double now = 0.;
30
- static int flash = 0;
31
static unsigned long sec_size = 0;
32
FILE *fp;
33
34
@@ -167,11 +161,7 @@ static void BlockDevice_sdb_ioStatsMeter_setValues(Meter* this, char* buffer, in
35
Platform_BlockDevice_sdb_stats.write_sectors_comp = Platform_BlockDevice_sdb_stats.write_sectors;
36
37
} else {
38
- if (!(flash % 2))
39
- xSnprintf(buffer, len, "%s", "unavailable");
40
- else
41
- xSnprintf(buffer, len, "%s", "");
42
- flash++;
43
+ xSnprintf(buffer, len, "%s", "unavailable");
44
}
45
}
46
47
@@ -198,7 +188,6 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in
48
char block_device[80];
49
static double old = 0.;
50
static double now = 0.;
51
- static int flash = 0;
52
static unsigned long sec_size = 0;
53
FILE *fp;
54
55
@@ -253,11 +242,7 @@ static void BlockDevice_sdc_ioStatsMeter_setValues(Meter* this, char* buffer, in
56
Platform_BlockDevice_sdc_stats.write_sectors_comp = Platform_BlockDevice_sdc_stats.write_sectors;
57
58
} else {
59
- if (!(flash % 2))
60
- xSnprintf(buffer, len, "%s", "unavailable");
61
- else
62
- xSnprintf(buffer, len, "%s", "");
63
- flash++;
64
+ xSnprintf(buffer, len, "%s", "unavailable");
65
}
66
}
67
68
@@ -284,7 +269,6 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in
69
char block_device[80];
70
static double old = 0.;
71
static double now = 0.;
72
- static int flash = 0;
73
static unsigned long sec_size = 0;
74
FILE *fp;
75
76
@@ -339,11 +323,7 @@ static void BlockDevice_sdd_ioStatsMeter_setValues(Meter* this, char* buffer, in
77
Platform_BlockDevice_sdd_stats.write_sectors_comp = Platform_BlockDevice_sdd_stats.write_sectors;
78
79
} else {
80
- if (!(flash % 2))
81
- xSnprintf(buffer, len, "%s", "unavailable");
82
- else
83
- xSnprintf(buffer, len, "%s", "");
84
- flash++;
85
+ xSnprintf(buffer, len, "%s", "unavailable");
86
}
87
}
88
89
@@ -370,7 +350,6 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer
90
char block_device[80];
91
static double old = 0.;
92
static double now = 0.;
93
- static int flash = 0;
94
static unsigned long sec_size = 0;
95
FILE *fp;
96
97
@@ -425,11 +404,7 @@ static void BlockDevice_mmcblk0_ioStatsMeter_setValues(Meter* this, char* buffer
98
Platform_BlockDevice_mmcblk0_stats.write_sectors_comp = Platform_BlockDevice_mmcblk0_stats.write_sectors;
99
100
} else {
101
- if (!(flash % 2))
102
- xSnprintf(buffer, len, "%s", "unavailable");
103
- else
104
- xSnprintf(buffer, len, "%s", "");
105
- flash++;
106
+ xSnprintf(buffer, len, "%s", "unavailable");
107
}
108
}
109
110
@@ -456,7 +431,6 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer
111
char block_device[80];
112
static double old = 0.;
113
static double now = 0.;
114
- static int flash = 0;
115
static unsigned long sec_size = 0;
116
FILE *fp;
117
118
@@ -511,11 +485,7 @@ static void BlockDevice_mmcblk1_ioStatsMeter_setValues(Meter* this, char* buffer
119
Platform_BlockDevice_mmcblk1_stats.write_sectors_comp = Platform_BlockDevice_mmcblk1_stats.write_sectors;
120
121
} else {
122
- if (!(flash % 2))
123
- xSnprintf(buffer, len, "%s", "unavailable");
124
- else
125
- xSnprintf(buffer, len, "%s", "");
126
- flash++;
127
+ xSnprintf(buffer, len, "%s", "unavailable");
128
}
129
}
130
131
@@ -542,7 +512,6 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer
132
char block_device[80];
133
static double old = 0.;
134
static double now = 0.;
135
- static int flash = 0;
136
static unsigned long sec_size = 0;
137
FILE *fp;
138
139
@@ -597,11 +566,7 @@ static void BlockDevice_mmcblk2_ioStatsMeter_setValues(Meter* this, char* buffer
140
Platform_BlockDevice_mmcblk2_stats.write_sectors_comp = Platform_BlockDevice_mmcblk2_stats.write_sectors;
141
142
} else {
143
- if (!(flash % 2))
144
- xSnprintf(buffer, len, "%s", "unavailable");
145
- else
146
- xSnprintf(buffer, len, "%s", "");
147
- flash++;
148
+ xSnprintf(buffer, len, "%s", "unavailable");
149
}
150
}
151
152
@@ -628,7 +593,6 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer
153
char block_device[80];
154
static double old = 0.;
155
static double now = 0.;
156
- static int flash = 0;
157
static unsigned long sec_size = 0;
158
FILE *fp;
159
160
@@ -683,11 +647,7 @@ static void BlockDevice_mmcblk3_ioStatsMeter_setValues(Meter* this, char* buffer
161
Platform_BlockDevice_mmcblk3_stats.write_sectors_comp = Platform_BlockDevice_mmcblk3_stats.write_sectors;
162
163
} else {
164
- if (!(flash % 2))
165
- xSnprintf(buffer, len, "%s", "unavailable");
166
- else
167
- xSnprintf(buffer, len, "%s", "");
168
- flash++;
169
+ xSnprintf(buffer, len, "%s", "unavailable");
170
}
171
}
172
173
diff --git a/CpuFreqMeter.c b/CpuFreqMeter.c
174
index 6508180..a2f39eb 100644
175
--- a/CpuFreqMeter.c
176
+++ b/CpuFreqMeter.c
177
@@ -23,7 +23,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
178
char buf_b[32];
179
char buf_l[32];
180
int ln = sizeof(buf_l);
181
- static int pulse = 0;
182
183
memset(buf_l, 0, sizeof(buf_l));
184
memset(buf_b, 0, sizeof(buf_b));
185
@@ -66,11 +65,7 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
186
xSnprintf(buf_l, ln, "%4d MHz", Freq);
187
}
188
189
- if (pulse)
190
- xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l, pulse);
191
- else
192
- xSnprintf(buffer, len, "%s %s ", buf_b, buf_l, pulse);
193
- pulse = !pulse;
194
+ xSnprintf(buffer, len, "%s %s (big.LITTLE)", buf_b, buf_l);
195
return;
196
}
197
198
@@ -89,7 +84,6 @@ static void CpuFreqMeter_setValues(Meter* this, char* buffer, int len) {
199
} else {
200
xSnprintf(buffer, len, "%4d MHz", Freq);
201
}
202
- pulse = !pulse;
203
}
204
205
MeterClass CpuFreqMeter_class = {
206
diff --git a/Eth0_Meter.c b/Eth0_Meter.c
207
index 90e512a..21e4b05 100644
208
--- a/Eth0_Meter.c
209
+++ b/Eth0_Meter.c
210
@@ -35,11 +35,10 @@ static void Eth0_Meter_setValues(Meter* this, char* buffer, int len) {
211
ret = findIP_interface("eth0", szIP, sizeof(szIP));
212
}
213
214
- if (ret) {
215
- xSnprintf(buffer, len, "%s", szIP);
216
- } else {
217
- xSnprintf(buffer, len, "%s", "down");
218
+ if (!ret) {
219
+ snprintf(szIP, sizeof(szIP), "%s", "down");
220
}
221
+ xSnprintf(buffer, len, "%s", szIP);
222
}
223
224
MeterClass Eth0_Meter_class = {
225
diff --git a/Eth0_StatsMeter.c b/Eth0_StatsMeter.c
226
index 974c656..1a42334 100644
227
--- a/Eth0_StatsMeter.c
228
+++ b/Eth0_StatsMeter.c
229
@@ -27,7 +27,6 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
230
double refreshdelay;
231
static double old = 0.;
232
static double now = 0.;
233
- static int flash = 0;
234
235
now = get_wall_time();
236
refreshdelay = now - old;
237
@@ -57,11 +56,7 @@ static void Eth0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
238
Platform_Eth0_stats.tx_bytes_comp = Platform_Eth0_stats.tx_bytes;
239
240
} else {
241
- if (!(flash % 2))
242
- xSnprintf(buffer, len, "%s", "unavail");
243
- else
244
- xSnprintf(buffer, len, "%s", "");
245
- flash++;
246
+ xSnprintf(buffer, len, "%s", "unavail");
247
}
248
}
249
250
diff --git a/Eth1_Meter.c b/Eth1_Meter.c
251
index 41cfa05..181370f 100644
252
--- a/Eth1_Meter.c
253
+++ b/Eth1_Meter.c
254
@@ -35,11 +35,10 @@ static void Eth1_Meter_setValues(Meter* this, char* buffer, int len) {
255
ret = findIP_interface("eth1", szIP, sizeof(szIP));
256
}
257
258
- if (ret) {
259
- xSnprintf(buffer, len, "%s", szIP);
260
- } else {
261
- xSnprintf(buffer, len, "%s", "down");
262
+ if (!ret) {
263
+ snprintf(szIP, sizeof(szIP), "%s", "down");
264
}
265
+ xSnprintf(buffer, len, "%s", szIP);
266
}
267
268
MeterClass Eth1_Meter_class = {
269
diff --git a/Eth1_StatsMeter.c b/Eth1_StatsMeter.c
270
index 85e6dc9..e7c5718 100644
271
--- a/Eth1_StatsMeter.c
272
+++ b/Eth1_StatsMeter.c
273
@@ -27,7 +27,6 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {
274
double refreshdelay;
275
static double old = 0.;
276
static double now = 0.;
277
- static int flash = 0;
278
279
now = get_wall_time();
280
refreshdelay = now - old;
281
@@ -57,11 +56,7 @@ static void Eth1_StatsMeter_setValues(Meter* this, char* buffer, int len) {
282
Platform_Eth1_stats.tx_bytes_comp = Platform_Eth1_stats.tx_bytes;
283
284
} else {
285
- if (!(flash % 2))
286
- xSnprintf(buffer, len, "%s", "unavail");
287
- else
288
- xSnprintf(buffer, len, "%s", "");
289
- flash++;
290
+ xSnprintf(buffer, len, "%s", "unavail");
291
}
292
}
293
294
diff --git a/Wlan0_Meter.c b/Wlan0_Meter.c
295
index bf75623..8296a6c 100644
296
--- a/Wlan0_Meter.c
297
+++ b/Wlan0_Meter.c
298
@@ -33,11 +33,10 @@ static void Wlan0_Meter_setValues(Meter* this, char* buffer, int len) {
299
ret = findIP_interface("wlan0", szIP, sizeof(szIP));
300
}
301
302
- if (ret) {
303
- xSnprintf(buffer, len, "%s", szIP);
304
- } else {
305
- xSnprintf(buffer, len, "%s", "down");
306
+ if (!ret) {
307
+ snprintf(szIP, sizeof(szIP), "%s", "down");
308
}
309
+ xSnprintf(buffer, len, "%s", szIP);
310
}
311
312
MeterClass Wlan0_Meter_class = {
313
diff --git a/Wlan0_StatsMeter.c b/Wlan0_StatsMeter.c
314
index f920f9c..9ced108 100644
315
--- a/Wlan0_StatsMeter.c
316
+++ b/Wlan0_StatsMeter.c
317
@@ -27,7 +27,6 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
318
double refreshdelay;
319
static double old = 0.;
320
static double now = 0.;
321
- static int flash = 0;
322
323
now = get_wall_time();
324
refreshdelay = now - old;
325
@@ -57,11 +56,7 @@ static void Wlan0_StatsMeter_setValues(Meter* this, char* buffer, int len) {
326
Platform_Wlan0_stats.tx_bytes_comp = Platform_Wlan0_stats.tx_bytes;
327
328
} else {
329
- if (!(flash % 2))
330
- xSnprintf(buffer, len, "%s", "unavail");
331
- else
332
- xSnprintf(buffer, len, "%s", "");
333
- flash++;
334
+ xSnprintf(buffer, len, "%s", "unavail");
335
}
336
}
337
338
diff --git a/Wlan1_Meter.c b/Wlan1_Meter.c
339
index c5acd69..4c5fcea 100644
340
--- a/Wlan1_Meter.c
341
+++ b/Wlan1_Meter.c
342
@@ -35,11 +35,10 @@ static void Wlan1_Meter_setValues(Meter* this, char* buffer, int len) {
343
ret = findIP_interface("wlan1", szIP, sizeof(szIP));
344
}
345
346
- if (ret) {
347
- xSnprintf(buffer, len, "%s", szIP);
348
- } else {
349
- xSnprintf(buffer, len, "%s", "down");
350
+ if (!ret) {
351
+ snprintf(szIP, sizeof(szIP), "%s", "down");
352
}
353
+ xSnprintf(buffer, len, "%s", szIP);
354
}
355
356
MeterClass Wlan1_Meter_class = {
357
358