diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-21 11:09:40 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-04-21 11:09:40 +0000 |
| commit | 5e34ff29bcc870936ab18172f438a34d042d4e03 (patch) | |
| tree | a5e7a528f2f916eb883f1161eadceacdf2dca4be /procps | |
| parent | 8b814b4a349e2262c0ad25793b05206a14651ebb (diff) | |
| download | busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.gz busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.tar.bz2 busybox-w32-5e34ff29bcc870936ab18172f438a34d042d4e03.zip | |
*: mass renaming of USE_XXXX to IF_XXXX
and SKIP_XXXX to IF_NOT_XXXX - the second one was especially
badly named. It was not skipping anything!
Diffstat (limited to 'procps')
| -rw-r--r-- | procps/pidof.c | 12 | ||||
| -rw-r--r-- | procps/ps.c | 14 | ||||
| -rw-r--r-- | procps/top.c | 10 |
3 files changed, 18 insertions, 18 deletions
diff --git a/procps/pidof.c b/procps/pidof.c index 194239961..bf5e7841a 100644 --- a/procps/pidof.c +++ b/procps/pidof.c | |||
| @@ -10,10 +10,10 @@ | |||
| 10 | #include "libbb.h" | 10 | #include "libbb.h" |
| 11 | 11 | ||
| 12 | enum { | 12 | enum { |
| 13 | USE_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,) | 13 | IF_FEATURE_PIDOF_SINGLE(OPTBIT_SINGLE,) |
| 14 | USE_FEATURE_PIDOF_OMIT( OPTBIT_OMIT ,) | 14 | IF_FEATURE_PIDOF_OMIT( OPTBIT_OMIT ,) |
| 15 | OPT_SINGLE = USE_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0, | 15 | OPT_SINGLE = IF_FEATURE_PIDOF_SINGLE((1<<OPTBIT_SINGLE)) + 0, |
| 16 | OPT_OMIT = USE_FEATURE_PIDOF_OMIT( (1<<OPTBIT_OMIT )) + 0, | 16 | OPT_OMIT = IF_FEATURE_PIDOF_OMIT( (1<<OPTBIT_OMIT )) + 0, |
| 17 | }; | 17 | }; |
| 18 | 18 | ||
| 19 | int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 19 | int pidof_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| @@ -28,8 +28,8 @@ int pidof_main(int argc UNUSED_PARAM, char **argv) | |||
| 28 | 28 | ||
| 29 | /* do unconditional option parsing */ | 29 | /* do unconditional option parsing */ |
| 30 | opt = getopt32(argv, "" | 30 | opt = getopt32(argv, "" |
| 31 | USE_FEATURE_PIDOF_SINGLE ("s") | 31 | IF_FEATURE_PIDOF_SINGLE ("s") |
| 32 | USE_FEATURE_PIDOF_OMIT("o:", &omits)); | 32 | IF_FEATURE_PIDOF_OMIT("o:", &omits)); |
| 33 | 33 | ||
| 34 | #if ENABLE_FEATURE_PIDOF_OMIT | 34 | #if ENABLE_FEATURE_PIDOF_OMIT |
| 35 | /* fill omit list. */ | 35 | /* fill omit list. */ |
diff --git a/procps/ps.c b/procps/ps.c index 395cfcf56..b9a4aef15 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
| @@ -25,9 +25,9 @@ enum { MAX_WIDTH = 2*1024 }; | |||
| 25 | 25 | ||
| 26 | #if ENABLE_SELINUX | 26 | #if ENABLE_SELINUX |
| 27 | #define SELINUX_O_PREFIX "label," | 27 | #define SELINUX_O_PREFIX "label," |
| 28 | #define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" USE_FEATURE_PS_TIME(",time") ",args") | 28 | #define DEFAULT_O_STR (SELINUX_O_PREFIX "pid,user" IF_FEATURE_PS_TIME(",time") ",args") |
| 29 | #else | 29 | #else |
| 30 | #define DEFAULT_O_STR ("pid,user" USE_FEATURE_PS_TIME(",time") ",args") | 30 | #define DEFAULT_O_STR ("pid,user" IF_FEATURE_PS_TIME(",time") ",args") |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | typedef struct { | 33 | typedef struct { |
| @@ -425,7 +425,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv) | |||
| 425 | { | 425 | { |
| 426 | procps_status_t *p; | 426 | procps_status_t *p; |
| 427 | llist_t* opt_o = NULL; | 427 | llist_t* opt_o = NULL; |
| 428 | USE_SELINUX(int opt;) | 428 | IF_SELINUX(int opt;) |
| 429 | 429 | ||
| 430 | // POSIX: | 430 | // POSIX: |
| 431 | // -a Write information for all processes associated with terminals | 431 | // -a Write information for all processes associated with terminals |
| @@ -439,7 +439,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv) | |||
| 439 | // Select which columns to display | 439 | // Select which columns to display |
| 440 | /* We allow (and ignore) most of the above. FIXME */ | 440 | /* We allow (and ignore) most of the above. FIXME */ |
| 441 | opt_complementary = "o::"; | 441 | opt_complementary = "o::"; |
| 442 | USE_SELINUX(opt =) getopt32(argv, "Zo:aAdefl", &opt_o); | 442 | IF_SELINUX(opt =) getopt32(argv, "Zo:aAdefl", &opt_o); |
| 443 | if (opt_o) { | 443 | if (opt_o) { |
| 444 | do { | 444 | do { |
| 445 | parse_o(llist_pop(&opt_o)); | 445 | parse_o(llist_pop(&opt_o)); |
| @@ -486,8 +486,8 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 486 | { | 486 | { |
| 487 | procps_status_t *p = NULL; | 487 | procps_status_t *p = NULL; |
| 488 | int len; | 488 | int len; |
| 489 | SKIP_SELINUX(const) int use_selinux = 0; | 489 | IF_NOT_SELINUX(const) int use_selinux = 0; |
| 490 | USE_SELINUX(int i;) | 490 | IF_SELINUX(int i;) |
| 491 | #if !ENABLE_FEATURE_PS_WIDE | 491 | #if !ENABLE_FEATURE_PS_WIDE |
| 492 | enum { terminal_width = 79 }; | 492 | enum { terminal_width = 79 }; |
| 493 | #else | 493 | #else |
| @@ -498,7 +498,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | |||
| 498 | #if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX | 498 | #if ENABLE_FEATURE_PS_WIDE || ENABLE_SELINUX |
| 499 | #if ENABLE_FEATURE_PS_WIDE | 499 | #if ENABLE_FEATURE_PS_WIDE |
| 500 | opt_complementary = "-:ww"; | 500 | opt_complementary = "-:ww"; |
| 501 | USE_SELINUX(i =) getopt32(argv, USE_SELINUX("Z") "w", &w_count); | 501 | IF_SELINUX(i =) getopt32(argv, IF_SELINUX("Z") "w", &w_count); |
| 502 | /* if w is given once, GNU ps sets the width to 132, | 502 | /* if w is given once, GNU ps sets the width to 132, |
| 503 | * if w is given more than once, it is "unlimited" | 503 | * if w is given more than once, it is "unlimited" |
| 504 | */ | 504 | */ |
diff --git a/procps/top.c b/procps/top.c index b5951422b..8738156e1 100644 --- a/procps/top.c +++ b/procps/top.c | |||
| @@ -889,7 +889,7 @@ int top_main(int argc UNUSED_PARAM, char **argv) | |||
| 889 | int lines_rem; | 889 | int lines_rem; |
| 890 | unsigned interval; | 890 | unsigned interval; |
| 891 | char *str_interval, *str_iterations; | 891 | char *str_interval, *str_iterations; |
| 892 | SKIP_FEATURE_TOPMEM(const) unsigned scan_mask = TOP_MASK; | 892 | IF_NOT_FEATURE_TOPMEM(const) unsigned scan_mask = TOP_MASK; |
| 893 | #if ENABLE_FEATURE_USE_TERMIOS | 893 | #if ENABLE_FEATURE_USE_TERMIOS |
| 894 | struct termios new_settings; | 894 | struct termios new_settings; |
| 895 | struct pollfd pfd[1]; | 895 | struct pollfd pfd[1]; |
| @@ -1054,11 +1054,11 @@ int top_main(int argc UNUSED_PARAM, char **argv) | |||
| 1054 | if (c == 'q') | 1054 | if (c == 'q') |
| 1055 | break; | 1055 | break; |
| 1056 | if (c == 'n') { | 1056 | if (c == 'n') { |
| 1057 | USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;) | 1057 | IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;) |
| 1058 | sort_function[0] = pid_sort; | 1058 | sort_function[0] = pid_sort; |
| 1059 | } | 1059 | } |
| 1060 | if (c == 'm') { | 1060 | if (c == 'm') { |
| 1061 | USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;) | 1061 | IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;) |
| 1062 | sort_function[0] = mem_sort; | 1062 | sort_function[0] = mem_sort; |
| 1063 | #if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE | 1063 | #if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE |
| 1064 | sort_function[1] = pcpu_sort; | 1064 | sort_function[1] = pcpu_sort; |
| @@ -1067,13 +1067,13 @@ int top_main(int argc UNUSED_PARAM, char **argv) | |||
| 1067 | } | 1067 | } |
| 1068 | #if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE | 1068 | #if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE |
| 1069 | if (c == 'p') { | 1069 | if (c == 'p') { |
| 1070 | USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;) | 1070 | IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;) |
| 1071 | sort_function[0] = pcpu_sort; | 1071 | sort_function[0] = pcpu_sort; |
| 1072 | sort_function[1] = mem_sort; | 1072 | sort_function[1] = mem_sort; |
| 1073 | sort_function[2] = time_sort; | 1073 | sort_function[2] = time_sort; |
| 1074 | } | 1074 | } |
| 1075 | if (c == 't') { | 1075 | if (c == 't') { |
| 1076 | USE_FEATURE_TOPMEM(scan_mask = TOP_MASK;) | 1076 | IF_FEATURE_TOPMEM(scan_mask = TOP_MASK;) |
| 1077 | sort_function[0] = time_sort; | 1077 | sort_function[0] = time_sort; |
| 1078 | sort_function[1] = mem_sort; | 1078 | sort_function[1] = mem_sort; |
| 1079 | sort_function[2] = pcpu_sort; | 1079 | sort_function[2] = pcpu_sort; |
