aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--procps/mpstat.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/procps/mpstat.c b/procps/mpstat.c
index c628d6215..af3263d67 100644
--- a/procps/mpstat.c
+++ b/procps/mpstat.c
@@ -522,9 +522,7 @@ static void get_irqs_from_stat(struct stats_irq *irq)
522 FILE *fp; 522 FILE *fp;
523 char buf[1024]; 523 char buf[1024];
524 524
525 fp = fopen_for_read(PROCFS_STAT); 525 fp = xfopen_for_read(PROCFS_STAT);
526 if (!fp)
527 return;
528 526
529 while (fgets(buf, sizeof(buf), fp)) { 527 while (fgets(buf, sizeof(buf), fp)) {
530 //bb_error_msg("/proc/stat:'%s'", buf); 528 //bb_error_msg("/proc/stat:'%s'", buf);
@@ -644,9 +642,7 @@ static void get_uptime(data_t *uptime)
644 char buf[sizeof(long)*3 * 2 + 4]; /* enough for long.long */ 642 char buf[sizeof(long)*3 * 2 + 4]; /* enough for long.long */
645 unsigned long uptime_sec, decimal; 643 unsigned long uptime_sec, decimal;
646 644
647 fp = fopen_for_read(PROCFS_UPTIME); 645 fp = xfopen_for_read(PROCFS_UPTIME);
648 if (!fp)
649 return;
650 if (fgets(buf, sizeof(buf), fp)) { 646 if (fgets(buf, sizeof(buf), fp)) {
651 if (sscanf(buf, "%lu.%lu", &uptime_sec, &decimal) == 2) { 647 if (sscanf(buf, "%lu.%lu", &uptime_sec, &decimal) == 2) {
652 *uptime = (data_t)uptime_sec * G.hz + decimal * G.hz / 100; 648 *uptime = (data_t)uptime_sec * G.hz + decimal * G.hz / 100;