aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-03-15 16:13:23 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-03-15 16:13:23 +0100
commit41b1e2c39238ef1f333588b9a857e5af806bd157 (patch)
treee441860654f9b8c6233a57ae543297930c7d073c
parenta63e2a8cb2dd0d6819c1844c52344c3bd6f73659 (diff)
downloadbusybox-w32-41b1e2c39238ef1f333588b9a857e5af806bd157.tar.gz
busybox-w32-41b1e2c39238ef1f333588b9a857e5af806bd157.tar.bz2
busybox-w32-41b1e2c39238ef1f333588b9a857e5af806bd157.zip
nmeter: remove undocumented %NNNd specifier
function old new delta nmeter_main 707 745 +38 init_functions 48 44 -4 init_delay 63 - -63 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 38/-67) Total: -29 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/nmeter.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c
index 1cc908504..d6c46c657 100644
--- a/procps/nmeter.c
+++ b/procps/nmeter.c
@@ -342,14 +342,6 @@ static s_stat* init_literal(void)
342 return (s_stat*)s; 342 return (s_stat*)s;
343} 343}
344 344
345static s_stat* init_delay(const char *param)
346{
347 delta = strtoul(param, NULL, 0) * 1000; /* param can be "" */
348 deltanz = delta > 0 ? delta : 1;
349 need_seconds = (1000000%deltanz) != 0;
350 return NULL;
351}
352
353static s_stat* init_cr(const char *param UNUSED_PARAM) 345static s_stat* init_cr(const char *param UNUSED_PARAM)
354{ 346{
355 G.final_char = '\r'; 347 G.final_char = '\r';
@@ -817,8 +809,7 @@ static void FAST_FUNC collect_info(s_stat *s)
817 809
818typedef s_stat* init_func(const char *param); 810typedef s_stat* init_func(const char *param);
819 811
820// Deprecated %NNNd is to be removed, -d MSEC supersedes it 812static const char options[] ALIGN1 = "ncmsfixptbr";
821static const char options[] ALIGN1 = "ncmsfixptbdr";
822static init_func *const init_functions[] = { 813static init_func *const init_functions[] = {
823 init_if, 814 init_if,
824 init_cpu, 815 init_cpu,
@@ -830,7 +821,6 @@ static init_func *const init_functions[] = {
830 init_fork, 821 init_fork,
831 init_time, 822 init_time,
832 init_blk, 823 init_blk,
833 init_delay,
834 init_cr 824 init_cr
835}; 825};
836 826
@@ -853,8 +843,11 @@ int nmeter_main(int argc UNUSED_PARAM, char **argv)
853 is26 = (strstr(buf, " 2.4.") == NULL); 843 is26 = (strstr(buf, " 2.4.") == NULL);
854 } 844 }
855 845
856 if (getopt32(argv, "d:", &opt_d)) 846 if (getopt32(argv, "d:", &opt_d)) {
857 init_delay(opt_d); 847 delta = xatou(opt_d) * 1000;
848 deltanz = delta > 0 ? delta : 1;
849 need_seconds = (1000000 % deltanz) != 0;
850 }
858 argv += optind; 851 argv += optind;
859 852
860 if (!argv[0]) 853 if (!argv[0])