aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
Diffstat (limited to 'procps')
-rw-r--r--procps/nmeter.c8
-rw-r--r--procps/pmap.c12
-rw-r--r--procps/powertop.c2
-rw-r--r--procps/top.c2
4 files changed, 9 insertions, 15 deletions
diff --git a/procps/nmeter.c b/procps/nmeter.c
index 07b7abe2f..f08938654 100644
--- a/procps/nmeter.c
+++ b/procps/nmeter.c
@@ -952,11 +952,11 @@ int nmeter_main(int argc UNUSED_PARAM, char **argv)
reset_outbuf();
if (G.delta >= 0) {
- gettimeofday(&G.tv, NULL);
+ xgettimeofday(&G.tv);
usleep(G.delta > 1000000 ? 1000000 : G.delta - G.tv.tv_usec % G.deltanz);
}
- gettimeofday(&G.start, NULL);
+ xgettimeofday(&G.start);
G.tv = G.start;
while (1) {
collect_info(first);
@@ -971,7 +971,7 @@ int nmeter_main(int argc UNUSED_PARAM, char **argv)
if (G.delta >= 0) {
int rem;
// can be commented out, will sacrifice sleep time precision a bit
- gettimeofday(&G.tv, NULL);
+ xgettimeofday(&G.tv);
if (need_seconds)
rem = G.delta - ((ullong)G.tv.tv_sec*1000000 + G.tv.tv_usec) % G.deltanz;
else
@@ -983,7 +983,7 @@ int nmeter_main(int argc UNUSED_PARAM, char **argv)
}
usleep(rem);
}
- gettimeofday(&G.tv, NULL);
+ xgettimeofday(&G.tv);
}
/*return 0;*/
diff --git a/procps/pmap.c b/procps/pmap.c
index 9e541c707..408cbfce7 100644
--- a/procps/pmap.c
+++ b/procps/pmap.c
@@ -27,20 +27,14 @@
#include "libbb.h"
-#if ULONG_MAX == 0xffffffff
+#if ULLONG_MAX == 0xffffffff
# define TABS "\t"
-# define AFMT "8"
+# define AFMTLL "8"
# define DASHES ""
#else
# define TABS "\t\t"
-# define AFMT "16"
-# define DASHES "--------"
-#endif
-
-#if ULLONG_MAX == 0xffffffff
-# define AFMTLL "8"
-#else
# define AFMTLL "16"
+# define DASHES "--------"
#endif
enum {
diff --git a/procps/powertop.c b/procps/powertop.c
index d508b5f78..fc6018b7a 100644
--- a/procps/powertop.c
+++ b/procps/powertop.c
@@ -818,7 +818,7 @@ int powertop_main(int argc UNUSED_PARAM, char UNUSED_PARAM **argv)
for (i = 0; i < MAX_CSTATE_COUNT + 2; i++)
if (cstate_lines[i][0])
- fputs(cstate_lines[i], stdout);
+ fputs_stdout(cstate_lines[i]);
i = process_timer_stats();
#if ENABLE_FEATURE_POWERTOP_PROCIRQ
diff --git a/procps/top.c b/procps/top.c
index 8d39526ff..cadc4ecec 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -712,7 +712,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
);
if ((int)(scr_width - col) > 1)
read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm);
- fputs(line_buf, stdout);
+ fputs_stdout(line_buf);
/* printf(" %d/%d %lld/%lld", s->pcpu, total_pcpu,
cur_jif.busy - prev_jif.busy, cur_jif.total - prev_jif.total); */
s++;