aboutsummaryrefslogtreecommitdiff
path: root/procps/pidof.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-08 19:03:07 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-08 19:03:07 +0000
commit048ae3483e3ed87f390d42e420c021e6b2fe85fe (patch)
treee97daaa61ca25179f9cfd9251446d00521bb5ddb /procps/pidof.c
parent75b3ad9deb25bb7305f4e4c139991ac715d27238 (diff)
downloadbusybox-w32-048ae3483e3ed87f390d42e420c021e6b2fe85fe.tar.gz
busybox-w32-048ae3483e3ed87f390d42e420c021e6b2fe85fe.tar.bz2
busybox-w32-048ae3483e3ed87f390d42e420c021e6b2fe85fe.zip
Fiddling with llist to make memory management easier. Specifically, the
option to delete the contents of the list when we delete the list is a good thing. git-svn-id: svn://busybox.net/trunk/busybox@15037 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'procps/pidof.c')
-rw-r--r--procps/pidof.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/procps/pidof.c b/procps/pidof.c
index 5b3e53fdf..98008aaf1 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -65,7 +65,7 @@ int pidof_main(int argc, char **argv)
65 while (omits_p) { 65 while (omits_p) {
66 /* are we asked to exclude the parent's process ID? */ 66 /* are we asked to exclude the parent's process ID? */
67 if (!strncmp(omits_p->data, "%PPID", 5)) { 67 if (!strncmp(omits_p->data, "%PPID", 5)) {
68 omits_p = llist_free_one(omits_p); 68 llist_pop(&omits_p);
69 snprintf(getppid_str, sizeof(getppid_str), "%d", getppid()); 69 snprintf(getppid_str, sizeof(getppid_str), "%d", getppid());
70 omits_p = llist_add_to(omits_p, getppid_str); 70 omits_p = llist_add_to(omits_p, getppid_str);
71#if 0 71#if 0
@@ -117,7 +117,7 @@ int pidof_main(int argc, char **argv)
117 117
118#if ENABLE_FEATURE_PIDOF_OMIT 118#if ENABLE_FEATURE_PIDOF_OMIT
119 if (ENABLE_FEATURE_CLEAN_UP) 119 if (ENABLE_FEATURE_CLEAN_UP)
120 llist_free(omits); 120 llist_free(omits, NULL);
121#endif 121#endif
122 return fail ? EXIT_FAILURE : EXIT_SUCCESS; 122 return fail ? EXIT_FAILURE : EXIT_SUCCESS;
123} 123}