Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/procps/watch.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/watch.c
r3232 r3621 70 70 if (!(opt & 0x2)) { // no -t 71 71 const unsigned time_len = sizeof("1234-67-90 23:56:89"); 72 time_t t;73 72 74 73 // STDERR_FILENO is procps3 compat: 75 74 // "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); 77 76 if (new_width != width) { 78 77 width = new_width; … … 80 79 header = xasprintf("Every %us: %-*s", period, (int)width, cmd); 81 80 } 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 } 86 88 87 89 // compat: empty line between header and cmd output
Note:
See TracChangeset
for help on using the changeset viewer.