if (sparse && *dataLen == 0) {
if (virFileInData(fdin, &inData, §ionLen) < 0)
- goto error;
+ return -1;
if (length &&
sectionLen > length - total)
virReportSystemError(errno,
_("unable to seek in %s"),
fdinname);
- goto error;
+ return -1;
}
} else {
if (sparse &&
virReportSystemError(errno,
_("Unable to read %s"),
fdinname);
- goto error;
+ return -1;
}
msg->type = VIR_FDSTREAM_MSG_TYPE_DATA;
virFDStreamMsgQueuePush(fdst, &msg, fdout, fdoutname);
return got;
-
- error:
- return -1;
}
fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0) {
virReportSystemError(errno, "%s", _("Unable to open UNIX socket"));
- goto error;
+ return -1;
}
memset(&sa, 0, sizeof(sa));
sa.sun_family = AF_UNIX;
if (abstract) {
if (virStrcpy(sa.sun_path+1, path, sizeof(sa.sun_path)-1) < 0)
- goto error;
+ return -1;
sa.sun_path[0] = '\0';
} else {
if (virStrcpyStatic(sa.sun_path, path) < 0)
- goto error;
+ return -1;
}
if (virTimeBackOffStart(&timeout, 1, 3*1000 /* ms */) < 0)
- goto error;
+ return -1;
while (virTimeBackOffWait(&timeout)) {
ret = connect(fd, (struct sockaddr *)&sa, sizeof(sa));
if (ret == 0)
continue;
}
- goto error;
+ return -1;
}
if (virFDStreamOpenInternal(st, fd, NULL, 0) < 0)
- goto error;
+ return -1;
fd = -1;
return 0;
-
- error:
- return -1;
}