mirror of https://gitee.com/openkylin/libvirt.git
logging: fix endless loop on EOF
On EOF condition we always have POLLHUP event and read returns 0 thus we never break loop in virLogHandlerDomainLogFileDrain. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7c0e1a8631
commit
bde9e2c6c0
|
@ -461,6 +461,8 @@ virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr file)
|
|||
if (errno == EINTR)
|
||||
continue;
|
||||
return;
|
||||
} else if (len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (virRotatingFileWriterAppend(file->file, buf, len) != len)
|
||||
|
|
Loading…
Reference in New Issue