Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/procps/mpstat.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/procps/mpstat.c
r3232 r3621 523 523 char buf[1024]; 524 524 525 fp = fopen_for_read(PROCFS_STAT); 526 if (!fp) 527 return; 525 fp = xfopen_for_read(PROCFS_STAT); 528 526 529 527 while (fgets(buf, sizeof(buf), fp)) { 530 528 //bb_error_msg("/proc/stat:'%s'", buf); 531 if ( strncmp(buf, "intr ", 5) == 0) {529 if (is_prefixed_with(buf, "intr ")) { 532 530 /* Read total number of IRQs since system boot */ 533 531 sscanf(buf + 5, "%"FMT_DATA"u", &irq->irq_nr); … … 645 643 unsigned long uptime_sec, decimal; 646 644 647 fp = fopen_for_read(PROCFS_UPTIME); 648 if (!fp) 649 return; 645 fp = xfopen_for_read(PROCFS_UPTIME); 650 646 if (fgets(buf, sizeof(buf), fp)) { 651 647 if (sscanf(buf, "%lu.%lu", &uptime_sec, &decimal) == 2) { … … 776 772 /* Initialization */ 777 773 778 /* Get number of clock ticks per sec */779 static ALWAYS_INLINE unsigned get_hz(void)780 {781 return sysconf(_SC_CLK_TCK);782 }783 784 774 static void alloc_struct(int cpus) 785 775 { … … 874 864 875 865 /* Get number of clock ticks per sec */ 876 G.hz = get_hz();866 G.hz = bb_clk_tck(); 877 867 878 868 /* Calculate number of interrupts per processor */
Note:
See TracChangeset
for help on using the changeset viewer.