summaryrefslogtreecommitdiff
path: root/procps/ps.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-01-07 16:13:14 +0000
committerDenis Vlasenko2008-01-07 16:13:14 +0000
commit6b404431aa7adea24120894d59daeebc5cbe9727 (patch)
treef3ccda749daf6fe9f80f4ee99fbb5d1b0ed4cbb7 /procps/ps.c
parent4e9ca75281a25dcdbb3e2d2fa79108b02afa43db (diff)
downloadbusybox-6b404431aa7adea24120894d59daeebc5cbe9727.zip
busybox-6b404431aa7adea24120894d59daeebc5cbe9727.tar.gz
ps: fix build breakage from vda's recent commit
*: whitespace fixes
Diffstat (limited to 'procps/ps.c')
-rw-r--r--procps/ps.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/procps/ps.c b/procps/ps.c
index 6a6a9e6..a46e92a 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -66,60 +66,60 @@ struct globals {
/* for ELF executables, notes are pushed before environment and args */
static ptrdiff_t find_elf_note(ptrdiff_t findme)
{
- ptrdiff_t *ep = (ptrdiff_t *) environ;
-
- while (*ep++);
- while (*ep) {
- if (ep[0] == findme) {
- return ep[1];
- }
- ep += 2;
- }
- return -1;
+ ptrdiff_t *ep = (ptrdiff_t *) environ;
+
+ while (*ep++);
+ while (*ep) {
+ if (ep[0] == findme) {
+ return ep[1];
+ }
+ ep += 2;
+ }
+ return -1;
}
#if ENABLE_FEATURE_PS_UNUSUAL_SYSTEMS
static unsigned get_HZ_by_waiting(void)
{
- struct timeval tv1, tv2;
- unsigned t1, t2, r, hz;
- unsigned cnt = cnt; /* for compiler */
- int diff;
-
- r = 0;
-
- /* Wait for times() to reach new tick */
- t1 = times(NULL);
- do {
- t2 = times(NULL);
- } while (t2 == t1);
- gettimeofday(&tv2, NULL);
-
- do {
- t1 = t2;
- tv1.tv_usec = tv2.tv_usec;
-
- /* Wait exactly one times() tick */
- do {
- t2 = times(NULL);
- } while (t2 == t1);
- gettimeofday(&tv2, NULL);
-
- /* Calculate ticks per sec, rounding up to even */
- diff = tv2.tv_usec - tv1.tv_usec;
- if (diff <= 0) diff += 1000000;
- hz = 1000000u / (unsigned)diff;
- hz = (hz+1) & ~1;
+ struct timeval tv1, tv2;
+ unsigned t1, t2, r, hz;
+ unsigned cnt = cnt; /* for compiler */
+ int diff;
+
+ r = 0;
+
+ /* Wait for times() to reach new tick */
+ t1 = times(NULL);
+ do {
+ t2 = times(NULL);
+ } while (t2 == t1);
+ gettimeofday(&tv2, NULL);
+
+ do {
+ t1 = t2;
+ tv1.tv_usec = tv2.tv_usec;
+
+ /* Wait exactly one times() tick */
+ do {
+ t2 = times(NULL);
+ } while (t2 == t1);
+ gettimeofday(&tv2, NULL);
+
+ /* Calculate ticks per sec, rounding up to even */
+ diff = tv2.tv_usec - tv1.tv_usec;
+ if (diff <= 0) diff += 1000000;
+ hz = 1000000u / (unsigned)diff;
+ hz = (hz+1) & ~1;
/* Count how many same hz values we saw */
- if (r != hz) {
- r = hz;
- cnt = 0;
- }
- cnt++;
- } while (cnt < 3); /* exit if saw 3 same values */
-
- return r;
+ if (r != hz) {
+ r = hz;
+ cnt = 0;
+ }
+ cnt++;
+ } while (cnt < 3); /* exit if saw 3 same values */
+
+ return r;
}
#else
static inline unsigned get_HZ_by_waiting(void)
@@ -190,7 +190,7 @@ static void put_lu(char *buf, int size, unsigned long u)
char buf5[5];
/* see http://en.wikipedia.org/wiki/Tera */
- smart_ulltoa4( (u, buf5, " mgtpezy");
+ smart_ulltoa4(u, buf5, " mgtpezy");
buf5[5] = '\0';
sprintf(buf, "%.*s", size, buf5);
}