Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/procps/watch.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/watch.c

    r3232 r3621  
    7070        if (!(opt & 0x2)) { // no -t
    7171            const unsigned time_len = sizeof("1234-67-90 23:56:89");
    72             time_t t;
    7372
    7473            // STDERR_FILENO is procps3 compat:
    7574            // "watch ls 2>/dev/null" does not detect tty size
    76             get_terminal_width_height(STDERR_FILENO, &new_width, NULL);
     75            new_width = get_terminal_width(STDERR_FILENO);
    7776            if (new_width != width) {
    7877                width = new_width;
     
    8079                header = xasprintf("Every %us: %-*s", period, (int)width, cmd);
    8180            }
    82             time(&t);
    83             if (time_len < width)
    84                 strftime(header + width - time_len, time_len,
    85                     "%Y-%m-%d %H:%M:%S", localtime(&t));
     81            if (time_len < width) {
     82                strftime_YYYYMMDDHHMMSS(
     83                    header + width - time_len,
     84                    time_len,
     85                    /*time_t*:*/ NULL
     86                );
     87            }
    8688
    8789            // compat: empty line between header and cmd output
Note: See TracChangeset for help on using the changeset viewer.