Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/util-linux/dmesg.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/util-linux/dmesg.c
r2725 r3232 9 9 * Licensed under GPLv2, see file LICENSE in this source tree. 10 10 */ 11 12 //usage:#define dmesg_trivial_usage 13 //usage: "[-c] [-n LEVEL] [-s SIZE]" 14 //usage:#define dmesg_full_usage "\n\n" 15 //usage: "Print or control the kernel ring buffer\n" 16 //usage: "\n -c Clear ring buffer after printing" 17 //usage: "\n -n LEVEL Set console logging level" 18 //usage: "\n -s SIZE Buffer size" 19 11 20 #include <sys/klog.h> 12 21 #include "libbb.h" … … 51 60 int in = 0; 52 61 53 /* Skip < #> at the start of lines */62 /* Skip <[0-9]+> at the start of lines */ 54 63 while (1) { 55 64 if (last == '\n' && buf[in] == '<') { 56 in += 3; 57 if (in >= len) 58 break; 65 while (buf[in++] != '>' && in < len) 66 ; 67 } else { 68 last = buf[in++]; 69 putchar(last); 59 70 } 60 last = buf[in];61 putchar(last);62 in++;63 71 if (in >= len) 64 72 break;
Note:
See TracChangeset
for help on using the changeset viewer.