diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-25 04:54:13 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-25 04:54:13 +0000 |
commit | 6446c2d4aba02eef0d8553c882f8d235288a66d9 (patch) | |
tree | 1637549e2c7e6432e6ec36774d0e5aa48e0bf44e /procps | |
parent | 72e76044cfda377486a5199a0d35d71edf669a42 (diff) | |
download | busybox-w32-6446c2d4aba02eef0d8553c882f8d235288a66d9.tar.gz busybox-w32-6446c2d4aba02eef0d8553c882f8d235288a66d9.tar.bz2 busybox-w32-6446c2d4aba02eef0d8553c882f8d235288a66d9.zip |
which: fix testsuite failure
pidof: do not output empty line if nothing found
testsuite: disable false positive
Diffstat (limited to 'procps')
-rw-r--r-- | procps/pidof.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/procps/pidof.c b/procps/pidof.c index f29561789..86d1957a6 100644 --- a/procps/pidof.c +++ b/procps/pidof.c | |||
@@ -47,12 +47,13 @@ int pidof_main(int argc, char **argv) | |||
47 | } | 47 | } |
48 | #endif | 48 | #endif |
49 | /* Looks like everything is set to go. */ | 49 | /* Looks like everything is set to go. */ |
50 | while (optind < argc) { | 50 | argv += optind; |
51 | while (*argv) { | ||
51 | pid_t *pidList; | 52 | pid_t *pidList; |
52 | pid_t *pl; | 53 | pid_t *pl; |
53 | 54 | ||
54 | /* reverse the pidlist like GNU pidof does. */ | 55 | /* reverse the pidlist like GNU pidof does. */ |
55 | pidList = pidlist_reverse(find_pid_by_name(argv[optind])); | 56 | pidList = pidlist_reverse(find_pid_by_name(*argv)); |
56 | for (pl = pidList; *pl; pl++) { | 57 | for (pl = pidList; *pl; pl++) { |
57 | #if ENABLE_FEATURE_PIDOF_OMIT | 58 | #if ENABLE_FEATURE_PIDOF_OMIT |
58 | if (opt & OPT_OMIT) { | 59 | if (opt & OPT_OMIT) { |
@@ -74,9 +75,10 @@ int pidof_main(int argc, char **argv) | |||
74 | #endif | 75 | #endif |
75 | } | 76 | } |
76 | free(pidList); | 77 | free(pidList); |
77 | optind++; | 78 | argv++; |
78 | } | 79 | } |
79 | bb_putchar('\n'); | 80 | if (!first) |
81 | bb_putchar('\n'); | ||
80 | 82 | ||
81 | #if ENABLE_FEATURE_PIDOF_OMIT | 83 | #if ENABLE_FEATURE_PIDOF_OMIT |
82 | if (ENABLE_FEATURE_CLEAN_UP) | 84 | if (ENABLE_FEATURE_CLEAN_UP) |