projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- spelling
[oweals/busybox.git]
/
procps
/
pidof.c
diff --git
a/procps/pidof.c
b/procps/pidof.c
index c142e33c8750ee3614cad1a073d2c0b51999d395..d9c8dca420a720c543b350be467e0f44f9163aa6 100644
(file)
--- a/
procps/pidof.c
+++ b/
procps/pidof.c
@@
-7,7
+7,7
@@
* Licensed under the GPL v2, see the file LICENSE in this tarball.
*/
* Licensed under the GPL v2, see the file LICENSE in this tarball.
*/
-
+#include "busybox.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@
-17,7
+17,6
@@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
-#include "busybox.h"
#if ENABLE_FEATURE_PIDOF_SINGLE
#define _SINGLE_COMPL(a) a
#if ENABLE_FEATURE_PIDOF_SINGLE
#define _SINGLE_COMPL(a) a
@@
-42,7
+41,7
@@
#define omitted (0)
#endif
#define omitted (0)
#endif
-
extern
int pidof_main(int argc, char **argv)
+int pidof_main(int argc, char **argv)
{
unsigned n = 0;
unsigned fail = 1;
{
unsigned n = 0;
unsigned fail = 1;
@@
-65,14
+64,9
@@
extern int pidof_main(int argc, char **argv)
while (omits_p) {
/* are we asked to exclude the parent's process ID? */
if (!strncmp(omits_p->data, "%PPID", 5)) {
while (omits_p) {
/* are we asked to exclude the parent's process ID? */
if (!strncmp(omits_p->data, "%PPID", 5)) {
-
omits_p = llist_free_one(
omits_p);
+
llist_pop(&
omits_p);
snprintf(getppid_str, sizeof(getppid_str), "%d", getppid());
snprintf(getppid_str, sizeof(getppid_str), "%d", getppid());
- omits_p = llist_add_to(omits_p, getppid_str);
-#if 0
- } else {
- bb_error_msg_and_die("illegal omit pid value (%s)!\n",
- omits_p->data);
-#endif
+ llist_add_to(&omits_p, getppid_str);
}
omits_p = omits_p->link;
}
}
omits_p = omits_p->link;
}
@@
-117,7
+111,7
@@
extern int pidof_main(int argc, char **argv)
#if ENABLE_FEATURE_PIDOF_OMIT
if (ENABLE_FEATURE_CLEAN_UP)
#if ENABLE_FEATURE_PIDOF_OMIT
if (ENABLE_FEATURE_CLEAN_UP)
- llist_free(omits);
+ llist_free(omits
, NULL
);
#endif
return fail ? EXIT_FAILURE : EXIT_SUCCESS;
}
#endif
return fail ? EXIT_FAILURE : EXIT_SUCCESS;
}