...otherwise the return 0 at the bottom is dead code.
Coverity-ID:
1055189
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
int marker = XC_SAVE_ID_COMPRESSED_DATA;
unsigned long compbuf_len = 0;
- do
+ for(;;)
{
/* check for available space (atleast 8k) */
if ((ob->pos + header + XC_PAGE_SIZE * 2) > ob->size)
ob->size - ob->pos - header,
&compbuf_len);
if (!rc)
- return 0;
+ break;
if (outbuf_hardwrite(xch, ob, fd, &marker, sizeof(marker)) < 0)
{
ERROR("Error when writing compressed chunk");
return -1;
}
- } while (rc != 0);
+ }
return 0;
}