rsyslog/rsyslog — pull request #138 by PaulSD (2014-10-15 22:30:31+00:00)
Title: bugfix imkmsg: infinite loop on OpenVZ VMs

On an OpenVZ VM, open("/dev/kmsg", ...) is successful, but read() fails. This triggers an unthrottled infinite loop since klogLogKMsg() does not propagate read errors up to runInput (presumably so that rsyslog can recover from transient read errors).

This pull request fixes the issue by calling read(0) and checking for EBADF before entering the loop.

See https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/1366829