Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/procps/mpstat.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/procps/mpstat.c

    r3232 r3621  
    523523    char buf[1024];
    524524
    525     fp = fopen_for_read(PROCFS_STAT);
    526     if (!fp)
    527         return;
     525    fp = xfopen_for_read(PROCFS_STAT);
    528526
    529527    while (fgets(buf, sizeof(buf), fp)) {
    530528        //bb_error_msg("/proc/stat:'%s'", buf);
    531         if (strncmp(buf, "intr ", 5) == 0) {
     529        if (is_prefixed_with(buf, "intr ")) {
    532530            /* Read total number of IRQs since system boot */
    533531            sscanf(buf + 5, "%"FMT_DATA"u", &irq->irq_nr);
     
    645643    unsigned long uptime_sec, decimal;
    646644
    647     fp = fopen_for_read(PROCFS_UPTIME);
    648     if (!fp)
    649         return;
     645    fp = xfopen_for_read(PROCFS_UPTIME);
    650646    if (fgets(buf, sizeof(buf), fp)) {
    651647        if (sscanf(buf, "%lu.%lu", &uptime_sec, &decimal) == 2) {
     
    776772/* Initialization */
    777773
    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 
    784774static void alloc_struct(int cpus)
    785775{
     
    874864
    875865    /* Get number of clock ticks per sec */
    876     G.hz = get_hz();
     866    G.hz = bb_clk_tck();
    877867
    878868    /* Calculate number of interrupts per processor */
Note: See TracChangeset for help on using the changeset viewer.