struct KMsg {
int fd;
- char buf[ 4096 ];
bool dev_kmsg() {
return fd >= 0;
void read( Sink *s ) {
int sz;
+ char buf[ 128 * 1024 ];
+
if ( dev_kmsg() ) {
while ( (sz = ::read(fd, buf, sizeof(buf) - 1)) > 0 )
s->push( std::string( buf, sz ) );
read( s );
}
} else {
- sz = klogctl( SYSLOG_ACTION_READ_CLEAR, buf, sizeof(buf) - 1 );
- if ( sz > 0 )
+ while ( (sz = klogctl( SYSLOG_ACTION_READ_CLEAR, buf, sizeof(buf) - 1 )) > 0 )
s->push( std::string( buf, sz ) );
}
}
KMsg kmsg;
int fd;
- char buf[ 4096 ];
virtual void push( std::string x ) {
for ( Sinks::iterator i = sinks.begin(); i != sinks.end(); ++i )
void sync() {
ssize_t sz;
+ char buf[ 128 * 1024 ];
+
while ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
push( std::string( buf, sz ) );