Commit 218f0a9b authored by Pavel Emelyanov's avatar Pavel Emelyanov

fifo: Fix false failure on fifo image reading

The ret var is set to -1 at the beginning and the very first loop
will break and report it to the caller thus stopping the restore :(
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 883126a4
......@@ -158,22 +158,20 @@ static int handle_fifo_data(void)
int collect_fifo(void)
{
struct fifo_info *info = NULL;
int img, ret = -1;
int img, ret;
img = open_image_ro(CR_FD_FIFO);
if (img < 0)
return -1;
while (1) {
ret = -1;
info = xzalloc(sizeof(*info));
if (info) {
info->fe = xzalloc(sizeof(*info->fe));
if (!info->fe)
ret = -1;
} else
ret = -1;
if (ret)
if (!info)
break;
info->fe = xzalloc(sizeof(*info->fe));
if (!info->fe)
break;
ret = read_img_eof(img, info->fe);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment