aboutsummaryrefslogtreecommitdiff
path: root/procps/pidof.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-08 12:49:22 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-08 12:49:22 +0000
commit87d25a2b8535dc627a02eb539fa3946be2a24647 (patch)
treefc4d14a910593d1235318bb36abe5e9f72d2039e /procps/pidof.c
parent81177b14907e73f11560f69e0b4ec34371f1a7d5 (diff)
downloadbusybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.gz
busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.tar.bz2
busybox-w32-87d25a2b8535dc627a02eb539fa3946be2a24647.zip
attempt to regularize atoi mess.
git-svn-id: svn://busybox.net/trunk/busybox@16342 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'procps/pidof.c')
-rw-r--r--procps/pidof.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/pidof.c b/procps/pidof.c
index e6c954843..62c590fd8 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -14,7 +14,7 @@
14#define SINGLE (1<<0) 14#define SINGLE (1<<0)
15#else 15#else
16#define _SINGLE_COMPL(a) 16#define _SINGLE_COMPL(a)
17#define SINGLE (0) 17#define SINGLE 0
18#endif 18#endif
19 19
20#if ENABLE_FEATURE_PIDOF_OMIT 20#if ENABLE_FEATURE_PIDOF_OMIT
@@ -56,7 +56,7 @@ int pidof_main(int argc, char **argv)
56 /* are we asked to exclude the parent's process ID? */ 56 /* are we asked to exclude the parent's process ID? */
57 if (!strncmp(omits_p->data, "%PPID", 5)) { 57 if (!strncmp(omits_p->data, "%PPID", 5)) {
58 llist_pop(&omits_p); 58 llist_pop(&omits_p);
59 snprintf(getppid_str, sizeof(getppid_str), "%d", getppid()); 59 snprintf(getppid_str, sizeof(getppid_str), "%ld", (long)getppid());
60 llist_add_to(&omits_p, getppid_str); 60 llist_add_to(&omits_p, getppid_str);
61 } 61 }
62 omits_p = omits_p->link; 62 omits_p = omits_p->link;
@@ -64,19 +64,19 @@ int pidof_main(int argc, char **argv)
64 } 64 }
65#endif 65#endif
66 /* Looks like everything is set to go. */ 66 /* Looks like everything is set to go. */
67 while(optind < argc) { 67 while (optind < argc) {
68 long *pidList; 68 long *pidList;
69 long *pl; 69 long *pl;
70 70
71 /* reverse the pidlist like GNU pidof does. */ 71 /* reverse the pidlist like GNU pidof does. */
72 pidList = pidlist_reverse(find_pid_by_name(argv[optind])); 72 pidList = pidlist_reverse(find_pid_by_name(argv[optind]));
73 for(pl = pidList; *pl > 0; pl++) { 73 for (pl = pidList; *pl > 0; pl++) {
74#if ENABLE_FEATURE_PIDOF_OMIT 74#if ENABLE_FEATURE_PIDOF_OMIT
75 unsigned omitted = 0; 75 unsigned omitted = 0;
76 if (opt & OMIT) { 76 if (opt & OMIT) {
77 llist_t *omits_p = omits; 77 llist_t *omits_p = omits;
78 while (omits_p) 78 while (omits_p)
79 if (strtol(omits_p->data, NULL, 10) == *pl) { 79 if (xatoul(omits_p->data) == *pl) {
80 omitted = 1; break; 80 omitted = 1; break;
81 } else 81 } else
82 omits_p = omits_p->link; 82 omits_p = omits_p->link;