mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
(s)size_t type cleanup
This commit is contained in:
parent
7e8ad2036a
commit
4cbe86fcb8
@ -1,3 +1,8 @@
|
|||||||
|
Thu Feb 19 09:14:56 CET 2009 Guido Günther <agx@sigxcpu.org>
|
||||||
|
|
||||||
|
* src/qemu_driver.c (qemudReadMonitorOutput, qemudReadLogOutput):
|
||||||
|
(s)size_t type cleanup
|
||||||
|
|
||||||
Tue Feb 17 20:40:51 EST 2009 Cole Robinson <crobinso@redhat.com>
|
Tue Feb 17 20:40:51 EST 2009 Cole Robinson <crobinso@redhat.com>
|
||||||
|
|
||||||
* src/qemu_driver.c: Remove the _actually_ incorrect
|
* src/qemu_driver.c: Remove the _actually_ incorrect
|
||||||
|
@ -594,18 +594,18 @@ qemudReadMonitorOutput(virConnectPtr conn,
|
|||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd,
|
int fd,
|
||||||
char *buf,
|
char *buf,
|
||||||
int buflen,
|
size_t buflen,
|
||||||
qemudHandlerMonitorOutput func,
|
qemudHandlerMonitorOutput func,
|
||||||
const char *what,
|
const char *what,
|
||||||
int timeout)
|
int timeout)
|
||||||
{
|
{
|
||||||
int got = 0;
|
size_t got = 0;
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
timeout *= 1000; /* poll wants milli seconds */
|
timeout *= 1000; /* poll wants milli seconds */
|
||||||
|
|
||||||
/* Consume & discard the initial greeting */
|
/* Consume & discard the initial greeting */
|
||||||
while (got < (buflen-1)) {
|
while (got < (buflen-1)) {
|
||||||
int ret;
|
ssize_t ret;
|
||||||
|
|
||||||
ret = read(fd, buf+got, buflen-got-1);
|
ret = read(fd, buf+got, buflen-got-1);
|
||||||
|
|
||||||
@ -672,17 +672,18 @@ qemudReadLogOutput(virConnectPtr conn,
|
|||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
int fd,
|
int fd,
|
||||||
char *buf,
|
char *buf,
|
||||||
int buflen,
|
size_t buflen,
|
||||||
qemudHandlerMonitorOutput func,
|
qemudHandlerMonitorOutput func,
|
||||||
const char *what,
|
const char *what,
|
||||||
int timeout)
|
int timeout)
|
||||||
{
|
{
|
||||||
int got = 0;
|
|
||||||
int ret;
|
|
||||||
int retries = timeout*10;
|
int retries = timeout*10;
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
|
||||||
while (retries) {
|
while (retries) {
|
||||||
|
ssize_t ret;
|
||||||
|
size_t got = 0;
|
||||||
|
|
||||||
while((ret = read(fd, buf+got, buflen-got-1)) > 0) {
|
while((ret = read(fd, buf+got, buflen-got-1)) > 0) {
|
||||||
got += ret;
|
got += ret;
|
||||||
buf[got] = '\0';
|
buf[got] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user