diff options
author | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
commit | 1385899416a4396385ad421ae1f532be7103738a (patch) | |
tree | fc4d14a910593d1235318bb36abe5e9f72d2039e /procps/pidof.c | |
parent | 5625415085e68ac5e150f54e685417c866620d76 (diff) | |
download | busybox-1385899416a4396385ad421ae1f532be7103738a.zip busybox-1385899416a4396385ad421ae1f532be7103738a.tar.gz |
attempt to regularize atoi mess.
Diffstat (limited to 'procps/pidof.c')
-rw-r--r-- | procps/pidof.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/procps/pidof.c b/procps/pidof.c index e6c9548..62c590f 100644 --- a/procps/pidof.c +++ b/procps/pidof.c @@ -14,7 +14,7 @@ #define SINGLE (1<<0) #else #define _SINGLE_COMPL(a) -#define SINGLE (0) +#define SINGLE 0 #endif #if ENABLE_FEATURE_PIDOF_OMIT @@ -56,7 +56,7 @@ int pidof_main(int argc, char **argv) /* are we asked to exclude the parent's process ID? */ if (!strncmp(omits_p->data, "%PPID", 5)) { llist_pop(&omits_p); - snprintf(getppid_str, sizeof(getppid_str), "%d", getppid()); + snprintf(getppid_str, sizeof(getppid_str), "%ld", (long)getppid()); llist_add_to(&omits_p, getppid_str); } omits_p = omits_p->link; @@ -64,19 +64,19 @@ int pidof_main(int argc, char **argv) } #endif /* Looks like everything is set to go. */ - while(optind < argc) { + while (optind < argc) { long *pidList; long *pl; /* reverse the pidlist like GNU pidof does. */ pidList = pidlist_reverse(find_pid_by_name(argv[optind])); - for(pl = pidList; *pl > 0; pl++) { + for (pl = pidList; *pl > 0; pl++) { #if ENABLE_FEATURE_PIDOF_OMIT unsigned omitted = 0; if (opt & OMIT) { llist_t *omits_p = omits; while (omits_p) - if (strtol(omits_p->data, NULL, 10) == *pl) { + if (xatoul(omits_p->data) == *pl) { omitted = 1; break; } else omits_p = omits_p->link; |